Facing the following error (as seen in the below screenshot), while executing the COLLECT_LIST function in the CREATE TABLE query. Could anyone please advise on , how to run the query successfully?
As the error says: “Key missing from projection”. The (primary) key of the output table is the grouping attribute, i.e YZA in your case.
All TABLEs in ksqlDB, need a primary key, and thus you need to include YZA in the projection of your query (ie, you need to include it in the SELECT).
However, the query seems to have another issue: if you use COLLECT_LIST without a WINDOW clause, the result table will grow unbounded, and I actually believe that ksqlDB would reject your query for this reason.