You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ak...@apache.org on 2019/06/21 11:37:49 UTC

[carbondata] branch master updated: [CARBONDATA-3445] Aggregate query empty list error fix.

This is an automated email from the ASF dual-hosted git repository.

akashrn5 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new ed862ce  [CARBONDATA-3445] Aggregate query empty list error fix.
ed862ce is described below

commit ed862ce1845d7883720508adbd46fa4cdaa95cdc
Author: manishnalla1994 <ma...@gmail.com>
AuthorDate: Wed Jun 19 20:43:59 2019 +0530

    [CARBONDATA-3445] Aggregate query empty list error fix.
    
    Problem:
    In Aggregate query, CountStarPlan throws head of empty list error.
    When right node of join node has Aggregate node with the empty aggregate and group expression then it matches with the count() plan
    and we try to get the Head of the aggregate expression assuming only one aggregate expression is present.
    This happens only in Spark 2.3 so added an empty list check that if aggregate expression is empty, it will not treat as count() plan.
    
    Aggregate query empty list error fix.
    
    This closes #3300
---
 .../src/main/scala/org/apache/spark/sql/CarbonCatalystOperators.scala  | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonCatalystOperators.scala b/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonCatalystOperators.scala
index ff0b9e6..160c785 100644
--- a/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonCatalystOperators.scala
+++ b/integration/spark2/src/main/scala/org/apache/spark/sql/CarbonCatalystOperators.scala
@@ -179,6 +179,9 @@ object CountStarPlan {
     if (groupingExpressions.nonEmpty) {
       return false
     }
+    if (partialComputation.isEmpty) {
+      return false
+    }
     if (partialComputation.size > 1 && partialComputation.nonEmpty) {
       return false
     }