我正在尝试使用 EventHubsForeachWriter,如下所示:
val ehConf = EventHubsConf("YOUR_CONNECTION_STRING")
val writer = EventHubsForeachWriter(ehConf)
val query =
streamingSelectDF
.writeStream
.foreach(writer)
.outputMode("update")
.trigger(ProcessingTime("25 seconds"))
.start()
但我遇到了一个例外:
notebook:22: error: type mismatch;
found : org.apache.spark.sql.eventhubs.EventHubsForeachWriter
required: org.apache.spark.sql.ForeachWriter[org.apache.spark.sql.Row]
.foreach(writer)