This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyspark import SparkContext | |
from pyspark.sql import SparkSession | |
from pyspark.streaming import StreamingContext | |
from pyspark.streaming.kafka import KafkaUtils | |
def main(): | |
# Task configuration. | |
topic = "heartbeat" | |
brokerAddresses = "localhost:9092" | |
batchTime = 20 |
OlderNewer