OpenSearch/x-pack/plugin/sql
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
..
jdbc Add compatibility testing for JDBC driver (#60409) 2020-07-29 10:45:11 -07:00
qa {S,E}QL: Fix optimization of `NotEquals` in conjunctions (#65331) (#65449) 2020-11-24 13:20:32 -05:00
sql-action Upgrade to Lucene-8.7.0 (#64532) (#64537) 2020-11-03 16:57:04 +01:00
sql-cli Replace immediate task creations by using task avoidance api (#60071) (#60504) 2020-07-31 13:09:04 +02:00
sql-client [7.x] SQL: Redact credentials in connection exceptions (#58650) (#59025) 2020-07-04 11:29:06 +02:00
sql-proto SQL: Add option to provide the delimiter for the CSV format (#59907) (#60420) 2020-07-29 21:40:11 +02:00
src SQL: Fix the return type in the sign function (#64845) (#64968) 2020-11-11 17:07:17 -05:00
build.gradle SQL: Allow skip of bwc tests on `check` task (#62936) (#63089) 2020-09-30 20:03:19 +02:00