简体   繁体   中英

name is null error while doing group by column_name in confluent kafka ksql

I get error in confluent-5.0.0.

ksql>CREATE TABLE order_per_hour AS SELECT after->order_id,count(*) FROM transaction WINDOW SESSION(60 seconds) GROUP BY after->order_id;

name is null

error-name is null

after is the struct field in schema. simple select query without group by is working fine.

I've submitted a PR to add support for this to KSQL here https://github.com/confluentinc/ksql/pull/2076

Hope this helps,

Andy

Currently you can only use column names in the GROUP BY clause. As a work around you can write your query as the following:

CREATE STREAM foo AS SELECT after->order_id as o_id FROM transaction;
CREATE TABLE order_per_hour AS SELECT o_id,count(*) FROM foo WINDOW SESSION(60 seconds) GROUP BY o_id;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM