You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2021/12/23 01:01:58 UTC

[GitHub] [calcite] ILuffZhe commented on a change in pull request #2657: [CALCITE-4860] In Elasticsearch adapter, support NULLS FIRST and NULLS LAST query

ILuffZhe commented on a change in pull request #2657:
URL: https://github.com/apache/calcite/pull/2657#discussion_r774254972



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchSort.java
##########
@@ -62,6 +62,8 @@
     for (RelFieldCollation fieldCollation : collation.getFieldCollations()) {
       final String name = fields.get(fieldCollation.getFieldIndex()).getName();
       final String rawName = implementor.expressionItemMap.getOrDefault(name, name);
+      // if nulls order is not specified, default NULLS LAST/FIRST for ASC/DESC
+      implementor.addNullsSort(rawName, fieldCollation.nullDirection);

Review comment:
       No, it's not the same.
   I think it would be better to follow SQL behavior of NULLS order(NULLS LAST/FIRST for ASC/DESC), since Elasticsearch Adapter converts SQL semantics to ES scripts.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@calcite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org