-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
SQL: negative numbers are treated as ALIAS instead of literals in functions #33461
Labels
Comments
Pinging @elastic/es-search-aggs |
matriv
added a commit
to matriv/elasticsearch
that referenced
this issue
Sep 10, 2018
matriv
pushed a commit
that referenced
this issue
Sep 10, 2018
Previously, when an arithmetic function got applied on a table column in the `SELECT` clause, the name of the result column contained weird characters used internally when processing the SQL statement e.g.: SELECT CHAR(emp_no % 10000) FROM "test_emp" returned: CHAR((emp_no{f}#14) % 10000)) as the column name instead of: CHAR((emp_no) % 10000)) Also, fix an issue that causes a ClassCastException to be thrown when using functions where both arguments are literals. Closes #31869 Closes #33461
@matriv this one still doesn't work if the function with negative parameter is used in GROUP BY:
|
@astefan I think it's better to raise a new issue as this seems irrelevant to the previous. |
Actually the new issue you've mentioned is the same as #33361. |
I'll close this one, then, and we'll follow up in #33361. Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For functions that have parameters numerics, a negative number is not treated properly. Example, the
power
function, and always using one of the other parameters a field:select power(salary,-1) from test_emp;
gives the following stacktrace:The text was updated successfully, but these errors were encountered: