snuyanzin opened a new pull request #17922: URL: https://github.com/apache/flink/pull/17922
## What is the purpose of the change There are some problem queries with misprints like ```sql ELECT 1; /* comment */ SEECT 1; ``` Currently SQL client responses for such queries like `Non-query expression encountered in illegal context`. For larger queries it could be a time consuming task to understand what is wrong. The PR is aimed to provide more info for such queries like exact unknown token and start position. So it will help to faster detect issues. In fact this info is already present in `SqlParseException` in `pos` field. ## Brief change log In case of `SqlParseException` and message `Non-query expression encountered in illegal context` extract and show `pos` info ## Verifying this change There are tests added to _flink-table/flink-sql-client/src/test/resources/sql/select.q_ ## Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): (yes / **no**) - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / **no**) - The serializers: (yes / **no** / don't know) - The runtime per-record code paths (performance sensitive): (yes / **no** / don't know) - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / **no** / don't know) - The S3 file system connector: (yes / **no** / don't know) ## Documentation - Does this pull request introduce a new feature? (yes / **no**) - If yes, how is the feature documented? (**not applicable** / docs / JavaDocs / not documented) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org