Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KSQL 5.4 error says a stream is a table #3523

Closed
rmoff opened this issue Oct 10, 2019 · 2 comments · Fixed by #3885
Closed

KSQL 5.4 error says a stream is a table #3523

rmoff opened this issue Oct 10, 2019 · 2 comments · Fixed by #3885

Comments

@rmoff
Copy link
Contributor

rmoff commented Oct 10, 2019

CLI v5.4.0-beta190925193823, Server v5.4.0-beta190925193823

ksql> CREATE STREAM FOO WITH (KAFKA_TOPIC='ratings',VALUE_FORMAT='AVRO');

 Message
----------------
 Stream created
----------------
ksql> SELECT * FROM FOO;
Table 'FOO' is not materialized. KSQL currently only supports static queries on materialized aggregate tables. i.e. those created by a 'CREATE TABLE AS SELECT <fields> FROM <sources> GROUP BY <key>' style statement.
ksql>

The error message says that it's a TABLE, but I've created a STREAM. Also if I need to include EMIT CHANGES then this message should include the explanation as shown in #3521 because this is a statement that worked fine <5.4

@rmoff
Copy link
Contributor Author

rmoff commented Oct 10, 2019

Against another stream I get this instead:

ksql> SELECT * FROM CUSTOMERS_REKEYED;
Missing WHERE clause
Static queries currently require a WHERE clause that:
 - limits the query to a single ROWKEY, e.g. `SELECT * FROM X WHERE ROWKEY=Y;`.

Both objects are STREAMs so why the different error message?

ksql> SHOW STREAMS;

 Stream Name       | Kafka Topic           | Format
----------------------------------------------------
 CUSTOMERS_REKEYED | CUSTOMERS_REKEYED     | AVRO
 CUSTOMERS_STREAM  | asgard.demo.CUSTOMERS | AVRO
 FOO               | ratings               | AVRO
 POOR_RATINGS      | POOR_RATINGS          | AVRO
 RATINGS           | ratings               | AVRO
----------------------------------------------------
ksql> SELECT * FROM FOO;
Table 'FOO' is not materialized. KSQL currently only supports static queries on materialized aggregate tables. i.e. those created by a 'CREATE TABLE AS SELECT <fields> FROM <sources> GROUP BY <key>' style statement.
ksql> SELECT * FROM CUSTOMERS_REKEYED;
Missing WHERE clause
Static queries currently require a WHERE clause that:
 - limits the query to a single ROWKEY, e.g. `SELECT * FROM X WHERE ROWKEY=Y;`.

Same point as above for this different error message (Missing WHERE clause) - include the info about EMIT CHANGES (unless this error shouldn't occur for STREAM queries and is just a bug)

@big-andy-coates big-andy-coates mentioned this issue Oct 11, 2019
27 tasks
@big-andy-coates big-andy-coates self-assigned this Oct 11, 2019
big-andy-coates added a commit to big-andy-coates/ksql that referenced this issue Nov 18, 2019
Fixes: confluentinc#3523

Remove the 'table' in the error message 'Table `foo` is not materialized' as it won't always be a table: it could be a stream.
big-andy-coates added a commit that referenced this issue Nov 20, 2019
Fixes: #3523

Remove the 'table' in the error message 'Table `foo` is not materialized' as it won't always be a table: it could be a stream.
@rmoff
Copy link
Contributor Author

rmoff commented Dec 3, 2019

@big-andy-coates is this in ksqlDB 0.6? I still see the problem, e.g. against a STREAM:

ksql> select * from tweets_03;
Table 'TWEETS_03' is not materialized. Refer to https://cnfl.io/queries for info on query types. If you intended to issue a push query, resub
[…]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants