流终止时事件中心到数据块错误?

Event hub to databricks error as stream is terminated?

我一直在尝试建立一个概念证明,Azure Databricks 使用以下代码从我的事件中心读取数据:

connectionString = "Endpoint=sb://mystream.servicebus.windows.net/;EntityPath=theeventhub;SharedAccessKeyName=event_test;SharedAccessKey=mykeygoeshere12345"

ehConf = {
  'eventhubs.connectionString' : connectionString
}

df = spark \
  .readStream \
  .format("eventhubs") \
  .options(**ehConf) \
  .load()

readEventStream = df.withColumn("body", df["body"].cast("string"))
display(readEventStream)

我正在使用推荐的 azure_eventhubs_spark_2_11_2_3_6.jar 包 here 但我已经尝试了最新版本并不断收到消息

ERROR : Some streams terminated before this command could finish!

我使用了 databricks 运行时版本 6.1,并将其回滚到 5.3,但似乎无法启动 运行。我有一个将数据发送到事件中心的 Python 脚本,我只是看不到任何结果? 是包裹吗?或者我做错了什么?

更新:我正在从下载的 JAR 文件加载库。我删除了它,然后从 Maven 仓库中获取了它。测试后有效

它与以下配置完美配合:

Databrick 运行时:5.5 LTS(包括 Apache Spark 2.4.3、Scala 2.11)

Azure EventHub 库: com.microsoft.azure:azure-eventhubs-spark_2.11:2.3.13

使用上面的配置,可以从Azure Eventhubs中获取数据。

参考: Integrating Apache Spark with Azure Event Hubs

希望对您有所帮助。