Skip to content

SQL: Fix negation of equals comparison. #34680

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

Closed
wants to merge 1 commit into from

Conversation

matriv
Copy link
Contributor

@matriv matriv commented Oct 21, 2018

For other logical operators adding NOT in front of the expression
results in negation of the binary operator, e.g.:
NOT a > b becomes a <= b
but this is not the case for NOT a = b.

This implements the negation of equals when encountered in the SELECT
clause or needs to be translated to a painless script (e.g.:
HAVING NOT count(*) = 10)

Previously, an SqlIllegalArgumentException[Not supported yet] was
thrown.

Fixes: #34558

For other logical operators adding `NOT` in front of the expression
results in negation of the binary operator, e.g.:
`NOT a > b` becomes `a <= b`
but this is not the case for `NOT a = b`.

This implements the negation of equals when encountered in the SELECT
clause or needs to be translated to a painless script (e.g.:
`HAVING NOT count(*) = 10`)

Previously, an `SqlIllegalArgumentException[Not supported yet]` was
thrown.

Fixes: elastic#34558
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@matriv
Copy link
Contributor Author

matriv commented Oct 21, 2018

@costin @astefan I'm working on an alternative fix but struggling with null safety here: matriv@f4eedc4
Do you think I should continue this work or is the current solution good enough?

@matriv
Copy link
Contributor Author

matriv commented Oct 21, 2018

retest this please

@matriv
Copy link
Contributor Author

matriv commented Oct 30, 2018

superseded by #34877

@matriv matriv closed this Oct 30, 2018
@matriv matriv deleted the mt/fix-34558 branch February 7, 2019 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants