Spark 结构化流可视化
Spark Structured Streaming Visualization
我正在尝试可视化结构化流式处理中的流式处理查询。
我怎么能那样做?
我应该使用仪表板还是有任何其他工具?
我在网上找不到类似的东西。
DF = spark \
.readStream \
.format("kafka") \
.option("kafka.bootstrap.servers", bootstrapServers)\
.option("subscribe", topics)\
.load()\
.selectExpr("CAST(value AS STRING)")
...
query1 = prediction.writeStream.outputMode("update").format('console').start()
query1.awaitTermination()
尝试这样的事情 - queryName 线索:
斯卡拉
// Have all the aggregates in an in-memory table
val aggDF
.writeStream
.queryName("aggregates") // this query name will be the table name
.outputMode("complete")
.format("memory")
.start()
spark.sql("select * from aggregates").show()
pyspark
# Have all the aggregates in an in-memory table. The query name will be the table name
aggDF \
.writeStream \
.queryName("aggregates") \
.outputMode("complete") \
.format("memory") \
.start()
spark.sql("select * from aggregates").show() # interactively query in-memory table
DataBricks 的笔记本具有 display
功能。
我正在尝试可视化结构化流式处理中的流式处理查询。 我怎么能那样做? 我应该使用仪表板还是有任何其他工具?
我在网上找不到类似的东西。
DF = spark \
.readStream \
.format("kafka") \
.option("kafka.bootstrap.servers", bootstrapServers)\
.option("subscribe", topics)\
.load()\
.selectExpr("CAST(value AS STRING)")
...
query1 = prediction.writeStream.outputMode("update").format('console').start()
query1.awaitTermination()
尝试这样的事情 - queryName 线索:
斯卡拉
// Have all the aggregates in an in-memory table
val aggDF
.writeStream
.queryName("aggregates") // this query name will be the table name
.outputMode("complete")
.format("memory")
.start()
spark.sql("select * from aggregates").show()
pyspark
# Have all the aggregates in an in-memory table. The query name will be the table name
aggDF \
.writeStream \
.queryName("aggregates") \
.outputMode("complete") \
.format("memory") \
.start()
spark.sql("select * from aggregates").show() # interactively query in-memory table
DataBricks 的笔记本具有 display
功能。