confluentinc/ksql

PARTITION BY ROWTIME results in a key named ROWTIME

Open

#8,193 opened on 2021年9月29日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Java (5,739 stars) (1,048 forks)batch import
buggood first issuestreaming-engine

説明

Describe the bug When using PARTITION BY ROWTIME, the resulting output topic will have a key aliased as ROWTIME. Typically, this is a reserved column name, as it creates a conflict between the ROWTIME pseudocolumn in the output query and the ROWTIME user column (or in this case, the column generated by the PARTITION BY.

To Reproduce This works on master today (SHA d75f25466ded174f7ae894db919c445c6a51de3a).

CREATE STREAM a (id INT) WITH (kafka_topic='input', value_format='JSON',partitions=1);
CREATE STREAM b AS select * FROM a PARTITION BY ROWTIME;
SELECT * FROM b EMIT CHANGES;  -- "Multiple entries with same key: `ROWTIME`=`ROWTIME` BIGINT and `ROWTIME`=`ROWTIME` BIGINT. To index multiple values under a key, use Multimaps.index."

Expected behavior The PARTITION BY is executed and gives the key column a useful alias.

Actual behaviour The PARTITION BY does not alias the column, and bypasses checks we have in place to prevent aliasing columns with reserved names.

Additional context This may be a slightly larger problem in the context of KLIP-50 being released soon, as it introduces new pseudocolumns representing partition and offset, which are not consistent between the source and sink topic like timestamps.

コントリビューターガイド