OpenSearch/x-pack/plugin/ql
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
..
src {S,E}QL: Fix optimization of `NotEquals` in conjunctions (#65331) (#65449) 2020-11-24 13:20:32 -05:00
test EQL: Refactor testing infrastructure (#62928) 2020-09-28 14:22:56 +03:00
build.gradle Fix Eclipse build (#62733) (#62786) 2020-09-22 17:44:25 -04:00