【问题标题】:ksql what is the difference between the primary key and with KEYksql主键和带KEY有什么区别
【发布时间】:2020-08-05 14:12:37
【问题描述】:

ksql.

  1. primary key和with KEY then create ktable有什么区别?
  2. 应该同时应用它们吗?

【问题讨论】:

    标签: apache-kafka confluent-platform ksqldb


    【解决方案1】:

    在这两种情况下,它们都将代表消息键,当您考虑 Kafka 如何处理“表”时,这有点意义。

    但这两者之间也有区别:在第二种情况下,我们将 KEY 字段更多地视为一种优化技术。如您所见,在消息值中可以找到相同的字段,因此将从那里提取它。

    引用自官方文档页面:

     If the Kafka message key is also present as a field/column in the Kafka message value, you may set this property to associate the corresponding field/column with the implicit ROWKEY column (message key)
    

    关于您的第二个问题,如果您查看documentation 的最新版本,您会发现第二个查询不再有效。

    【讨论】:

      猜你喜欢
      • 2012-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-22
      • 2012-11-20
      • 2012-04-18
      相关资源
      最近更新 更多