You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ka...@apache.org on 2017/07/16 11:59:16 UTC
kylin git commit: KYLIN-2706 Should disable Storage limit push down
when singleValuesD doesn't containsAll othersD
Repository: kylin
Updated Branches:
refs/heads/master a9c9715d0 -> 0dc2cd466
KYLIN-2706 Should disable Storage limit push down when singleValuesD doesn't containsAll othersD
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/0dc2cd46
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/0dc2cd46
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/0dc2cd46
Branch: refs/heads/master
Commit: 0dc2cd4665efd32d2f782e53382f86e5dadb720a
Parents: a9c9715
Author: kangkaisen <ka...@meituan.com>
Authored: Sun Jul 16 19:59:40 2017 +0800
Committer: kangkaisen <ka...@meituan.com>
Committed: Sun Jul 16 20:00:06 2017 +0800
----------------------------------------------------------------------
.../kylin/storage/gtrecord/GTCubeStorageQueryBase.java | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/0dc2cd46/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 f89fc47..2e4aca3 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
@@ -143,7 +143,7 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery {
TupleFilter.collectColumns(filter, filterColumnD);
// set limit push down
- enableStorageLimitIfPossible(cuboid, groups, derivedPostAggregation, groupsD, filter, loosenedColumnD, sqlDigest.aggregations, context);
+ enableStorageLimitIfPossible(cuboid, groups, otherDimsD, singleValuesD, derivedPostAggregation, groupsD, filter, loosenedColumnD, sqlDigest.aggregations, context);
// set whether to aggregate results from multiple partitions
enableStreamAggregateIfBeneficial(cuboid, groupsD, context);
// set query deadline
@@ -340,7 +340,7 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery {
}
}
- private void enableStorageLimitIfPossible(Cuboid cuboid, Collection<TblColRef> groups, Set<TblColRef> derivedPostAggregation, Collection<TblColRef> groupsD, TupleFilter filter, Set<TblColRef> loosenedColumnD, Collection<FunctionDesc> functionDescs, StorageContext context) {
+ private void enableStorageLimitIfPossible(Cuboid cuboid, Collection<TblColRef> groups, Set<TblColRef> othersD, Set<TblColRef> singleValuesD, Set<TblColRef> derivedPostAggregation, Collection<TblColRef> groupsD, TupleFilter filter, Set<TblColRef> loosenedColumnD, Collection<FunctionDesc> functionDescs, StorageContext context) {
boolean possible = true;
if (!TupleFilter.isEvaluableRecursively(filter)) {
@@ -358,6 +358,13 @@ public abstract class GTCubeStorageQueryBase implements IStorageQuery {
logger.debug("Storage limit push down is impossible because the query has order by");
}
+ // other columns (from filter) is bad, unless they are ensured to have single value
+ if (singleValuesD.containsAll(othersD) == false) {
+ possible = false;
+ logger.debug("Storage limit push down is impossible because some column not on group by: " + othersD //
+ + " (single value column: " + singleValuesD + ")");
+ }
+
// derived aggregation is bad, unless expanded columns are already in group by
if (!groups.containsAll(derivedPostAggregation)) {
possible = false;