如何在 KSQLDB 聚合函数中设置 [ignoreNulls] 以不忽略空值

How to set [ignoreNulls] in KSQLDB aggregate functions to not ignore nulls

我尝试通过 KSQLDB 获取消息的最新值。因此我使用 LATEST_BY_OFFSET.

文档中是这样描述的:

Since: 0.13.0

EARLIEST_BY_OFFSET(col1, earliestN, [ignoreNulls])

Stream Return the earliest N values for the specified column as an ARRAY. The earliest valuesin the partition have the lowest offsets. The optional ignoreNulls parameter controls whether nulls are ignored. The default is to ignore null values.

如何将其设置为不忽略空值。我试过 0/1,true/false

我不确定我使用的是哪个版本的 ksqlDB。所以我发现Confluent Platform使用的是0.10版本(https://docs.confluent.io/platform/current/installation/versions-interoperability.html)

因此该命令无法工作。

但我发现很容易因为这一段而误读文档:

Since: 0.10.0

EARLIEST_BY_OFFSET(col1, [ignoreNulls])
Stream

Return the earliest value for the specified column. The earliest value in the partition

has the lowest offset.

The optional ignoreNulls parameter, available since version 0.13.0, controls whether nulls are ignored. The default

is to ignore null values.

所以他们写“Since 0.10.0”,加上ignoreNulls参数,说ignoreNulls只能被0.13版本使用。