即使经过多次尝试,我也无法在控制台上看到任何消息,也没有写入文件。
在我的代码下面:
df = spark.readStream.format("kafka")\
.option("kafka.bootstrap.servers","ipaddress:9092")\
.option("subscribe","mysql-server-1.inventory.customers")\
.option("partition.assignment.strategy", "range") \
.option("startingOffsets", "latest")\
.load()#.
df = df.selectExpr("CAST(key AS STRING)", "CAST(value AS STRING)")
print(df.printSchema())
print("Streaming : {}".format(df.isStreaming))
ds = df.writeStream\
.format("kafka")\
.option("kafka.bootstrap.servers", "ipaddress:9092")\
.option("topic", "mysql-server-1.inventory.customers")\
.option("checkpointLocation", "hdfs://ipaddress:9000/user/xxxx/check")\
.start()
ds.awaitTermination()
注意: