OpenSearch/x-pack/plugin/sql/qa/server
Andras Palinkas 7f7e938a25
{S,E}QL: Fix optimization of `NotEquals` in conjunctions (#65331) (#65449)
* Fix the `CombineBinaryComparisons` optimizer rule, so that semantic
equality taken into account during the optimization of `NotEquals`

Examples that previously removed the `NotEquals` expressions (leading
to incorrect results):

```
double >= 10 AND integer != 9
-->  double >= 10

keyword != '2021' AND datetime >= '2020-01-01T00:00:00'
--> datetime >= '2020-01-01T00:00:00'
```

With the fix, expressions like the above will not be touched.
`NotEquals` will only be eliminated from the `AND` expression if the
left side of the `NotEquals` `semanticEquals()` to the left side
of the other expressions within the conjunction (comparisons against
the same field/expression).

* Unit tests and integration tests

Close #65322
(cherry-picked from 8b2b7fa)
2020-11-24 13:20:32 -05:00
..
multi-node SQL: [Tests] Move JDBC integration tests to new module (#56872) (#57072) 2020-05-22 17:49:36 +02:00
security Deprecate REST access to System Indices (#63274) (Original #60945) 2020-10-06 13:41:40 -06:00
single-node SQL: [Tests] Move JDBC integration tests to new module (#56872) (#57072) 2020-05-22 17:49:36 +02:00
src/main {S,E}QL: Fix optimization of `NotEquals` in conjunctions (#65331) (#65449) 2020-11-24 13:20:32 -05:00
build.gradle Fix Eclipse build (#62733) (#62786) 2020-09-22 17:44:25 -04:00