OpenSearch/x-pack
Marios Trivyzas b0cb7bf229 SQL: Fix issue with GROUP BY YEAR() (#49559)
Grouping By YEAR() is translated to a histogram aggregation, but
previously if there was a scalar function invloved (e.g.:
`YEAR(date + INTERVAL 2 YEARS)`), there was no proper script created
and the histogram was applied on a field with name: `date + INTERVAL 2 YEARS`
which doesn't make sense, and resulted in null result.

Check the underlying field of YEAR() and if it's a function call
`asScript()` to properly get the painless script on which the histogram
is applied.

Fixes: #49386
(cherry picked from commit 93c37abc943d00d3a14ba08435d118a6d48874c7)
2019-11-26 14:11:11 +01:00
..
dev-tools Build: Merge xpack checkstyle config into core (#33399) 2018-09-05 09:17:02 -04:00
docs [DOCS] Rename auditing topic. Closes #49012 (#49013) 2019-11-22 14:16:58 -08:00
license-tools [Backport] Remove dependency substitutions 7.x (#42866) 2019-06-04 13:50:23 -07:00
plugin SQL: Fix issue with GROUP BY YEAR() (#49559) 2019-11-26 14:11:11 +01:00
qa Enable simple remote connection strategy (#49561) 2019-11-25 16:53:07 -07:00
snapshot-tool Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
test Document SAML APIs (#45105) (#47909) 2019-10-11 16:34:11 +03:00
transport-client Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
NOTICE.txt
README.md
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00: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.