OpenSearch/x-pack
Marios Trivyzas 7a34ba35f7
SQL: Fix bug with optimization of null related conditionals (#41355)
The SimplifyConditional rule is removing NULL literals from those
functions to simplify their evaluation. This happens in the Optimizer
and a new instance of the conditional function is generated. Previously,
the dataType was not set properly (defaulted to DataType.NULL) for
those new instances and since the resolveType() wasn't called again
it resulted in returning always null.

E.g.:

SELECT COALESCE(null, 'foo', null, 'bar')

COALESCE(null, 'foo', null, 'bar')
-----------------
null

This issue was not visible before because the tests always used an alias
for the conditional function which caused the resolveType() to be
called which sets the dataType properly.

E.g.:

SELECT COALESCE(null, 'foo', null, 'bar') as c

c
-----------------
foo

(cherry picked from commit c39980a65dd593363f1d8d1b038b26cb0ce02aaf)
2019-04-19 19:04:32 +03:00
..
dev-tools Build: Merge xpack checkstyle config into core (#33399) 2018-09-05 09:17:02 -04:00
docs [DOCS] Fixes deprecation notice in pagerduty action (#41362) 2019-04-18 17:33:07 -07:00
license-tools Switch mapping/aggregations over to java time (#36363) 2019-01-23 10:40:05 +01:00
plugin SQL: Fix bug with optimization of null related conditionals (#41355) 2019-04-19 19:04:32 +03:00
qa Remove string usages of old transport settings (#41207) 2019-04-15 16:54:24 -06:00
test Add an OpenID Connect authentication realm (#40674) (#41178) 2019-04-15 12:41:16 +03:00
transport-client Testing conventions now checks for tests in main (#37321) 2019-01-24 17:30:50 +02:00
NOTICE.txt Migrate x-pack-elasticsearch source to elasticsearch 2018-04-20 15:29:54 -07:00
README.md Reorganize license files 2018-04-20 15:33:59 -07:00
build.gradle Remove Migration Upgrade and Assistance APIs (#40075) 2019-03-18 13:46:56 -06:00

README.md

Elastic License Functionality

This directory tree contains files subject to the Elastic License. The files subject to the Elastic License are grouped in this directory to clearly separate them from files licensed under the Apache License 2.0.