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

ZheHu commented on CALCITE-4860:
--------------------------------

It seems that the ES scripts ignore 'nulls first', so the result is always 
returned as ES default "_last".

Hey, [~nobigo]. If you don't mind, I'm happy to look into this.

> Elasticsearch adapter support NULLS FIRST and NULLS LAST in ORDER BY
> --------------------------------------------------------------------
>
>                 Key: CALCITE-4860
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4860
>             Project: Calcite
>          Issue Type: Bug
>          Components: elasticsearch-adapter
>    Affects Versions: 1.27.0
>            Reporter: duan xiong
>            Priority: Major
>             Fix For: 1.29.0
>
>
> In Elasticsearch Adapter, The SQL:
> {code:java}
> @Test void integerCat3() {
>   CalciteAssert.that()
>       .with(newConnectionFactory())
>       .query("select cat1 from view order by cat1 nulls first")
>       .returns("cat1=a\n" +
>           "cat1=b\n" +
>           "cat1=null\n");
> }
> {code}
> NULLS FIRST don't handle.
> According  
> [es_missing_values|https://www.elastic.co/guide/en/elasticsearch/reference/current/sort-search-results.html#_missing_values]
>  . We can add another parameter in the script to implement this.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to