KSQL - 非流式查询

KSQL - Non-streaming query

有没有办法查询KTABLE中的所有当前条目?我正在尝试使用负载

执行对 REST api 的 http 请求
{
  "ksql": "SELECT * FROM MY_KTABLE;",
  "streamsProperties": {
      "auto.offset.reset": "earliest"
   }
}

并且流无限期挂起。文档说

It is the equivalent of a traditional database table but enriched by streaming semantics such as windowing.

那么当你只需要所有当前数据而不需要流式传输并将KTABLE视为常规缓存时,是否可以进行常规查询table?

KSQL Table 使用了 Kafka Streams 的 KTable 因此为了访问 KTable 的当前值,您需要访问所有流实例中的状态存储工作。在 Kafka Streams 中,您可以使用 interactive queries 执行此操作,但是,我们尚不支持 KSQL 中的交互式查询。

在 KSQL 中查看 table 当前状态的一种解决方法是使用 Kafka Connect 将对应于 Table 的 kafka 主题推送到外部 table 中,例如Postgres table 或 Cassandra table。此外部 table 将具有 KSQL table.

的最新值