【问题标题】:Databricks: Azure Queue Storage structured streaming key not found errorDatabricks:未找到 Azure 队列存储结构化流式传输密钥错误
【发布时间】:2021-10-11 06:48:02
【问题描述】:

我正在尝试为 AQS 流数据编写 ETL 管道。这是我的代码

CONN_STR = dbutils.secrets.get(scope="kvscope", key = "AZURE-STORAGE-CONN-STR")

schema = StructType([
    StructField("id", IntegerType()),
    StructField("parkingId", IntegerType()),
    StructField("capacity", IntegerType()),
    StructField("freePlaces", IntegerType()),
    StructField("insertTime", TimestampType())
  ])

stream = spark.readStream \
.format("abs-aqs") \
.option("fileFormat", "json") \
.option("queueName", "freeparkingplaces") \
.option("connectionString", CONN_STR) \
.schema(schema) \
.load()

display(stream)

当我运行它时,我得到java.util.NoSuchElementException: key not found: eventType

这是我的队列的样子

你能发现并解释一下是什么问题吗?

【问题讨论】:

    标签: pyspark databricks azure-databricks spark-structured-streaming azure-storage-queues


    【解决方案1】:

    abs-aqs 连接器不是用于使用来自 AQS 的数据,而是用于使用报告给 AQS 的事件获取有关 blob 存储中新文件的数据。这就是您指定文件格式选项和架构的原因 - 但这些参数将应用于文件,而不是 AQS 中的消息。

    据我所知(我可能是错的),没有用于 AQS 的 Spark 连接器,通常建议使用 EventHubs 或 Kafka 作为消息传递解决方案。

    【讨论】:

      猜你喜欢
      • 2020-06-04
      • 2020-07-17
      • 2022-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-29
      • 1970-01-01
      相关资源
      最近更新 更多