OpenSearch/x-pack/plugin
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
..
analytics (refactor) Extract Empty/Script/Missing ValuesSource behavior to an interface (#48320) (#49330) 2019-11-19 16:44:29 -05:00
ccr Enable simple remote connection strategy (#49561) 2019-11-25 16:53:07 -07:00
core Fix expired job results deletion audit message (#49560) 2019-11-26 10:48:12 +00:00
deprecation Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
enrich Reuse collected cluster state in EnrichPolicyRunner (#48488) (#49100) 2019-11-14 14:14:39 -05:00
frozen-indices Pre-sort shards based on the max/min value of the primary sort field (#49092) 2019-11-22 11:02:12 +01:00
graph Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
ilm Fix SLMSnapshotBlockingIntegTests.testSnapshotInProgress (#49533) (#49542) 2019-11-25 13:31:45 +01:00
logstash Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
mapper-flattened Add telemetry for flattened fields. (#48972) (#49125) 2019-11-18 12:29:42 -08:00
ml [7.x][ML] Only report complete writing_results progress after completion (#49551) (#49577) 2019-11-26 12:20:37 +02:00
monitoring Monitoring should wait with collecting data when cluster service is started. (#49426) 2019-11-21 14:22:41 +01:00
rollup Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
search-business-rules Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
security Deprecate misconfigured SSL server config (#49280) 2019-11-22 12:14:55 +11:00
spatial Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
sql SQL: Fix issue with GROUP BY YEAR() (#49559) 2019-11-26 14:11:11 +01:00
src/test [ML] Add default categorization analyzer definition to ML info (#49545) 2019-11-25 13:39:16 +00:00
transform [Transform] add debug log for configuration index (#49484) 2019-11-25 09:49:17 +01:00
vectors Increase the number of vector dims to 2048 (#46895) 2019-11-20 07:47:33 -05:00
voting-only-node Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00
watcher Deprecate misconfigured SSL server config (#49280) 2019-11-22 12:14:55 +11:00
build.gradle Apply 2-space indent to all gradle scripts (#49071) 2019-11-14 11:01:23 +00:00