OpenSearch/x-pack/plugin/sql
Bogdan Pintea f04b4cbee8
SQL: Optimisation fixes for conjunction merges (#50703) (#50933)
* SQL: Optimisation fixes for conjunction merges

This commit fixes the following issues around the way comparisions are
merged with ranges in conjunctions:
* the decision to include the equality of the lower limit is corrected;
* the selection of the upper limit is corrected to use the upper bound
of the range;
* the list of terms in the conjunction is sorted to have the ranges at
the bottom; this allows subsequent binary comarisions to find compatible
ranges and potentially be merged away. The end guarantee being that the
optimisation takes place irrespective of the order of the conjunction
terms in the statement.

Some comments are also corrected.

* adress review observation on anon. comparator

Replace anonymous comparator of split AND Expressions with a lambda.

(cherry picked from commit 9828cb143a41f1bda1219541f3a8fdc03bf6dd14)
2020-01-13 21:51:29 +01:00
..
jdbc Handle NULL in ResultSet's getDate() method (#50184) 2019-12-17 10:03:23 +02:00
qa Make .async-search-* a restricted namespace (#50294) 2020-01-13 12:20:54 +02:00
sql-action Upgrade to Lucene 8.4.0. (#50518) (#50750) 2020-01-08 18:53:59 +01:00
sql-cli Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
sql-client Clean up static web server in sql-client tests (#49187) (#49197) 2019-11-15 13:02:21 -07:00
sql-proto Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
src SQL: Optimisation fixes for conjunction merges (#50703) (#50933) 2020-01-13 21:51:29 +01:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00