-
Notifications
You must be signed in to change notification settings - Fork 148
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
[BUG] Multiplication in queries are treated as an alias #265
Comments
Thanks for reporting this issue, this seems due to unhandled corner cases for the parsers. We will give it a fix once we have resources. |
@dai-chen @penghuo The current strategy uses state to save whether we're in a FROM clause or not (all other clauses use the default state... more on this below). The state is exited when the index name token is parsed. So, only in this state can we accept non-sql characters in the identifier. A cleaner solution would be to save states for each clause, but that's a major change. The parser only fails in unique cases where the test has sub-queries. We need to find out how to accommodate sub-queries, and it seems like the best strategy would be to save state in modes as a stack (push state when entering the sub-query, exit state when we exit the sub-query). See test output for review: https://github.com/Bit-Quill/opensearch-project-sql/actions/runs/3268789572 |
Describe the bug
Multiplication in queries are treated as an alias if there is no space between * and the value.
Or for query issues:
Expected behavior
The result should be 1 similar to result of the query 'SELECT 1/1'
Screenshots



Additional context
'SELECT 1 * 1' works however when TDVT testing, generated queries do not include a space between * and the second value.
The text was updated successfully, but these errors were encountered: