流终止时,事件中心到databricks错误?

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存储库中获得了它。经过测试后可以正常工作

daihongze 回答:流终止时,事件中心到databricks错误?

它与以下配置完美配合:

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中获取流数据。

enter image description here

参考: Integrating Apache Spark with Azure Event Hubs

希望这会有所帮助。

本文链接:https://www.f2er.com/3143507.html

大家都在问