[ 
https://issues.apache.org/jira/browse/CALCITE-2689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17446733#comment-17446733
 ] 

Julian Hyde commented on CALCITE-2689:
--------------------------------------

Thank you!

> ES Adapter. Grouping on date / number fields fails
> --------------------------------------------------
>
>                 Key: CALCITE-2689
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2689
>             Project: Calcite
>          Issue Type: Improvement
>          Components: elasticsearch-adapter
>            Reporter: Andrei Sereda
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.18.0
>
>
> For [TermsĀ 
> Aggregation|https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html]
>  missing value has to have same type as group key:
> {code:sql}
> select max(amount), date from orders group by date -- date column is of type 
> date (in ES)
> {code}
> Currently single (text) key is used {{__MISSING__}} which fails when grouping 
> on non-string fields (eg. dates, numbers or booleans).
> When using {{missing}} (value) query converter should consider field type.
> This logic should be reviewed once we migrate to [composite 
> aggregations|https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html]
>  (available since 
> [6.1|https://www.elastic.co/guide/en/elasticsearch/reference/6.1/release-notes-6.1.0.html]
>  see PR[26800|https://github.com/elastic/elasticsearch/pull/26800])



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to