Complete the code to read a streaming DataFrame from a Kafka source.
df = spark.readStream.format([1]).option("kafka.bootstrap.servers", "localhost:9092").option("subscribe", "topic1").load()
Complete the code to write the streaming DataFrame to the console sink.
query = df.writeStream.format([1]).outputMode("append").start()
Fix the error in the code to filter streaming data for values greater than 100.
filtered_df = df.filter(df.value [1] 100)
Fill both blanks to create a streaming aggregation that counts events per user.
agg_df = df.groupBy([1]).agg([2]("*").alias("event_count"))
Fill all three blanks to create a streaming query that writes aggregated data to a checkpointed console sink.
query = agg_df.writeStream.format([1]).option("checkpointLocation", [2]).outputMode([3]).start()
