【问题标题】:Ingest base64 encoded avro messages in druid在德鲁伊中摄取 base64 编码的 avro 消息
【发布时间】:2023-02-07 09:20:50
【问题描述】:

我想在德鲁伊中摄取 base64 编码的 avro 消息。我收到以下错误 -

Avro's unnecessary EOFException, detail: https://issues.apache.org/jira/browse/AVRO-813

通过代码(第 88 行)https://github.com/apache/druid/blob/master/extensions-core/avro-extensions/src/main/java/org/apache/druid/data/input/avro/InlineSchemaAvroBytesDecoder.java,它似乎没有使用 base64 解码器解码消息。我错过了什么吗?我们如何配置德鲁伊来解析 base64 编码的 avro 消息?

使用的规格 -

"inputFormat": {
        "type": "avro_stream",
        "avroBytesDecoder": {
          "type": "schema_inline",
          "schema": {
            "namespace": "org.apache.druid.data",
            "name": "User",
            "type": "record",
            "fields": [
              {
                "name": "id",
                "type": "string"
              },
              {
                "name": "price",
                "type": "int"
              }
            ]
          }
        },
        "flattenSpec": {
          "useFieldDiscovery": true,
          "fields": [
            {
              "type": "path",
              "name": "someRecord_subInt",
              "expr": "$.someRecord.subInt"
            }
          ]
        },
        "binaryAsString": false
      }

谢谢:)

【问题讨论】:

    标签: base64 avro druid


    【解决方案1】:

    我没有使用 Avro 摄取,但从 Apache Druid docs here 看来您需要将“binaryAsString”设置为 true。

    The extension returns bytes and fixed Avro types as base64 encoded strings by default. To decode these types as UTF-8 strings, enable the binaryAsString option on the Avro parser.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多