在 Confluence kafka 中的主题中发布数据,显示除 ID 列之外的所有空值

问题描述 投票:0回答:1

Avro 架构值和 Avro 架构键:Confluent Control Center UI


{
  "namespace": "com.kaggle.onlineretail",
  "name": "product",
  "type": "record",
  "fields": [
    {
      "name": "ID",
      "type": ["null", "int"],
      "default": null
    },
    {
      "name": "name",
      "type": ["null", "string"],
      "default": null
    },
    {
      "name": "category",
      "type": ["null", "string"],
      "default": null
    },
    {
      "name": "price",
      "type": ["null", "float"],
      "default": null
    },
    {
      "name": "last_updated",
      "type": ["null",{
        "type": "long",
        "logicalType": "timestamp-millis"   
    }]
}
  ]
}


{
    "namespace": "com.kaggle.onlineretail",
    "name": "Product",
    "type": "record",
    "fields": [
      {
        "name": "Id",
        "type": "int"
      }
    ]
}

分区键是ID

生产者脚本将从 mysql 表中提取的数据发布到主题中,但在 Confluence kafka 站点上它显示空值,附上图像。

注意:我可以看到 mysql 表中存在数据,甚至当我在 python 中的生产者代码中获取数据时也存在数据

apache-kafka avro
1个回答
0
投票

当我在 python 中的生产者代码中获取数据时存在数据

生产者不“取”。假设您指的是消费者,那么控制中心 UI 在尝试使用 Avro 时会出现错误(它甚至不允许您使用架构生成 Avro 数据)。如果可用的话,Ksql UI 更好,否则您必须联系 Confluence 支持。

© www.soinside.com 2019 - 2024. All rights reserved.