kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject kylin git commit: bug fix: if outer query does not have aggr, join columns with subquery should not be added to groupbycolumns
Date Fri, 04 Nov 2016 00:59:31 GMT
Repository: kylin
Updated Branches:
  refs/heads/yang21 cfd78bba0 -> 44d4fe8c5


bug fix: if outer query does not have aggr, join columns with subquery should not be added
to groupbycolumns


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/44d4fe8c
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/44d4fe8c
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/44d4fe8c

Branch: refs/heads/yang21
Commit: 44d4fe8c590dd2f7822acce40715832cc7a08432
Parents: cfd78bb
Author: Hongbin Ma <mahongbin@apache.org>
Authored: Fri Nov 4 08:59:12 2016 +0800
Committer: Hongbin Ma <mahongbin@apache.org>
Committed: Fri Nov 4 08:59:12 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/metadata/realization/SQLDigest.java    | 9 +++++++++
 .../kylin/storage/gtrecord/GTCubeStorageQueryBase.java      | 7 +------
 2 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/44d4fe8c/core-metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigest.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigest.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigest.java
index 3aa39e4..e60d785 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigest.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/realization/SQLDigest.java
@@ -70,6 +70,15 @@ public class SQLDigest {
         //the reason to choose aggregations rather than metricColumns is because the former
is set earlier at implOLAP
     }
 
+    public void includeSubqueryJoinParticipants() {
+        if (this.isRawQuery) {
+            this.allColumns.addAll(this.subqueryJoinParticipants);
+        } else {
+            this.groupbyColumns.addAll(this.subqueryJoinParticipants);
+            this.allColumns.addAll(this.subqueryJoinParticipants);
+        }
+    }
+
     @Override
     public String toString() {
         return "fact table " + this.factTable + "," + //

http://git-wip-us.apache.org/repos/asf/kylin/blob/44d4fe8c/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
----------------------------------------------------------------------
diff --git a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
index 86d66af..7dc6afa 100644
--- a/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
+++ b/core-storage/src/main/java/org/apache/kylin/storage/gtrecord/GTCubeStorageQueryBase.java
@@ -75,12 +75,7 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery {
     public ITupleIterator search(StorageContext context, SQLDigest sqlDigest, TupleInfo returnTupleInfo)
{
 
         //deal with participant columns in subquery join
-        if (sqlDigest.isRawQuery) {
-            sqlDigest.allColumns.addAll(sqlDigest.subqueryJoinParticipants);
-        } else {
-            sqlDigest.groupbyColumns.addAll(sqlDigest.subqueryJoinParticipants);
-            sqlDigest.allColumns.addAll(sqlDigest.subqueryJoinParticipants);
-        }
+        sqlDigest.includeSubqueryJoinParticipants();
 
         //cope with queries with no aggregations
         RawQueryLastHacker.hackNoAggregations(sqlDigest, cubeDesc);


Mime
View raw message