-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better error message when users enter old style syntax for query (…
…#3397) * fix: better error message when users enter old style syntax for query Say a user executes `SELECT * FROM X JOIN Y ON X.ID = Y.ID;` or similar. In older versions of KSQL this would be a streaming join and would work. With the introduction of static queries this example is now a static query, which don't support joins. Hence the user will get the error: `Static queries do not support joins`... which isn't very helpful if you don't know the query syntax has changed. With this PR the output is now: ``` Static queries do not support joins. Did you mean to execute a continuous query? If so, add an 'EMIT CHANGES' clause. Query syntax in KSQL has changed. There are now two broad categories of queries: - Static queries: query the current state of the system, return a result and terminate. - Streaming queries: query the state of the system in motion and will continue to output results until they meet any LIMIT clause criteria or are terminated by the user. 'EMIT CHANGES' is used to indicate a query is continuous and outputs all changes. To turn a static query into a streaming query, as was the default in older versions of KSQL, add `EMIT CHANGES` to the end of the statement before any limit clause. For example, the following are static queries: 'SELECT * FROM X WHERE ROWKEY=Y;' (non-windowed table) 'SELECT * FROM X WHERE ROWKEY=Y AND WINDOWSTART>=Z;' (windowed table) and, the following is a streaming query: 'SELECT * FROM X EMIT CHANGES;' Note: Persistent queries, e.g. `CREATE TABLE AS ...`, currently have an implicit `EMIT CHANGES`. However, it is recommended to add `EMIT CHANGES` to such statements going forward, as a this will be required in a future release. ```
- Loading branch information
1 parent
078e114
commit f948ec0
Showing
11 changed files
with
153 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.