Repository: kylin Updated Branches: refs/heads/beforepomupdate d257d73bd -> ebf037d39
KYLIN-1922 revert Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ebf037d3 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ebf037d3 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ebf037d3 Branch: refs/heads/beforepomupdate Commit: ebf037d390329cdc512050944908bb0fb0309896 Parents: d257d73 Author: Hongbin Ma <mahong...@apache.org> Authored: Thu Jul 28 15:14:38 2016 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Thu Jul 28 15:14:38 2016 +0800 ---------------------------------------------------------------------- .../gtrecord/GTCubeStorageQueryBase.java | 23 +++++--------------- 1 file changed, 6 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/ebf037d3/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 fc145e6..3cc7bb8 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 @@ -20,7 +20,6 @@ package org.apache.kylin.storage.gtrecord; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -100,8 +99,9 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery { // isExactAggregation? meaning: tuples returned from storage requires no further aggregation in query engine Set<TblColRef> singleValuesD = findSingleValueColumns(filter); - context.setExactAggregation(isExactAggregation(cuboid, groups, otherDimsD, singleValuesD, derivedPostAggregation)); - context.setNeedStorageAggregation(isNeedStorageAggregation(cuboid, groupsD, singleValuesD)); + boolean exactAggregation = isExactAggregation(cuboid, groups, otherDimsD, singleValuesD, derivedPostAggregation); + context.setExactAggregation(exactAggregation); + context.setNeedStorageAggregation(isNeedStorageAggregation(cuboid, groupsD, singleValuesD, exactAggregation)); // replace derived columns in filter with host columns; columns on loosened condition must be added to group by TupleFilter filterD = translateDerived(filter, groupsD); @@ -222,22 +222,11 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery { return resultD; } - private boolean isNeedStorageAggregation(Cuboid cuboid, Collection<TblColRef> groupD, Collection<TblColRef> singleValueD) { - - logger.info("GroupD :" + groupD); - logger.info("SingleValueD :" + singleValueD); - logger.info("Cuboid columns :" + cuboid.getColumns()); - HashSet<TblColRef> temp = Sets.newHashSet(); - temp.addAll(groupD); - temp.addAll(singleValueD); - if (cuboid.getColumns().size() != temp.size()) { - return false; - } else { - return true; - } + public boolean isNeedStorageAggregation(Cuboid cuboid, Collection<TblColRef> groupD, Collection<TblColRef> singleValueD, boolean isExactAggregation) { + return !isExactAggregation; } - private boolean isExactAggregation(Cuboid cuboid, Collection<TblColRef> groups, Set<TblColRef> othersD, Set<TblColRef> singleValuesD, Set<TblColRef> derivedPostAggregation) { + public boolean isExactAggregation(Cuboid cuboid, Collection<TblColRef> groups, Set<TblColRef> othersD, Set<TblColRef> singleValuesD, Set<TblColRef> derivedPostAggregation) { boolean exact = true; if (cuboid.requirePostAggregation()) {