OpenSearch/x-pack/plugin/sql/qa
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
..
multi-node Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
no-sql SQL: handle SQL not being available in a more graceful way (#43665) 2019-07-10 14:36:24 +03:00
security Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
single-node SQL: binary communication implementation for drivers and the CLI (#48261) 2019-10-31 20:39:41 -04:00
src/main SQL: Fix issue with GROUP BY YEAR() (#49559) 2019-11-26 14:11:11 +01:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00