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 2020/06/18 02:19:46 UTC

[GitHub] [calcite] XuQianJin-Stars commented on a change in pull request #2033: [CALCITE-4069] Elasticsearch adapter. Optimize the process of adding count(*) to the result set.

XuQianJin-Stars commented on a change in pull request #2033:
URL: https://github.com/apache/calcite/pull/2033#discussion_r441930568



##########
File path: elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/ElasticsearchTable.java
##########
@@ -287,11 +287,11 @@ String scriptedFieldPrefix() {
       result.add(new LinkedHashMap<>());
     }
 
-    // elastic exposes total number of documents matching a query in "/hits/total" path
-    // this can be used for simple "select count(*) from table"
-    final long total = res.searchHits().total().value();
+    if (groupBy.isEmpty() && aggregations.size() == 1) {

Review comment:
       aggregations.size() == 1  -> aggregations.size()>0 ?




----------------------------------------------------------------
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.

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