kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [8/8] incubator-kylin git commit: KYLIN-780 minor changes about debug
Date Wed, 17 Jun 2015 10:14:11 GMT
KYLIN-780 minor changes about debug


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

Branch: refs/heads/KYLIN-780
Commit: dc878ac36c62ef545f766392ac402c766849a2fa
Parents: f379ff4
Author: Li, Yang <yangli9@ebay.com>
Authored: Wed Jun 17 18:13:44 2015 +0800
Committer: Li, Yang <yangli9@ebay.com>
Committed: Wed Jun 17 18:13:44 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/metadata/project/ProjectL2Cache.java |  2 +-
 .../org/apache/kylin/query/enumerator/CubeEnumerator.java |  5 +----
 .../org/apache/kylin/query/relnode/OLAPAggregateRel.java  |  2 +-
 .../java/org/apache/kylin/query/relnode/OLAPJoinRel.java  |  1 -
 .../main/java/org/apache/kylin/query/relnode/OLAPRel.java |  5 +++++
 .../kylin/query/relnode/OLAPToEnumerableConverter.java    | 10 +++++++---
 .../java/org/apache/kylin/query/test/KylinTestBase.java   |  2 +-
 7 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
index 10c4472..bc1b3a6 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/project/ProjectL2Cache.java
@@ -256,7 +256,7 @@ class ProjectL2Cache {
     private static class TableCache {
         private boolean exposed = false;
         private TableDesc tableDesc;
-        private Set<ColumnDesc> exposedColumns = Sets.newHashSet();
+        private Set<ColumnDesc> exposedColumns = Sets.newLinkedHashSet();
         private Set<IRealization> realizations = Sets.newHashSet();
 
         TableCache(TableDesc tableDesc) {

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/query/src/main/java/org/apache/kylin/query/enumerator/CubeEnumerator.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/enumerator/CubeEnumerator.java b/query/src/main/java/org/apache/kylin/query/enumerator/CubeEnumerator.java
index cc89119..b83e449 100644
--- a/query/src/main/java/org/apache/kylin/query/enumerator/CubeEnumerator.java
+++ b/query/src/main/java/org/apache/kylin/query/enumerator/CubeEnumerator.java
@@ -132,11 +132,9 @@ public class CubeEnumerator implements Enumerator<Object[]> {
         // bind dynamic variables
         bindVariable(olapContext.filter);
 
-
-
         // query storage engine
         IStorageEngine storageEngine = StorageEngineFactory.getStorageEngine(olapContext.realization);
-        ITupleIterator iterator = storageEngine.search(olapContext.storageContext,olapContext.getSQLDigest());
+        ITupleIterator iterator = storageEngine.search(olapContext.storageContext, olapContext.getSQLDigest());
         if (logger.isDebugEnabled()) {
             logger.debug("return TupleIterator...");
         }
@@ -145,7 +143,6 @@ public class CubeEnumerator implements Enumerator<Object[]> {
         return iterator;
     }
 
-
     private void bindVariable(TupleFilter filter) {
         if (filter == null) {
             return;

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
index 277cd22..cb41c4f 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPAggregateRel.java
@@ -348,7 +348,7 @@ public class OLAPAggregateRel extends Aggregate implements OLAPRel, EnumerableRe
         try {
             enumAggRel = new EnumerableAggregate(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE),
getInput(), false, this.groupSet, this.groupSets, rewriteAggCalls);
         } catch (InvalidRelException e) {
-            throw new IllegalStateException("Can't create EnumerableAggregateRel!", e);
+            throw new IllegalStateException("Can't create EnumerableAggregate!", e);
         }
 
         return enumAggRel.implement(implementor, pref);

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/query/src/main/java/org/apache/kylin/query/relnode/OLAPJoinRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPJoinRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPJoinRel.java
index cb0c65f..6be2b7f 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPJoinRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPJoinRel.java
@@ -230,7 +230,6 @@ public class OLAPJoinRel extends EnumerableJoin implements OLAPRel {
             result = super.implement(implementor, pref);
         } else {
             PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(),
pref.preferArray());
-
             RelOptTable factTable = context.firstTableScan.getTable();
             result = implementor.result(physType, Blocks.toBlock(Expressions.call(factTable.getExpression(OLAPTable.class),
"executeIndexQuery", implementor.getRootExpression(), Expressions.constant(context.id))));
         }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/query/src/main/java/org/apache/kylin/query/relnode/OLAPRel.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPRel.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPRel.java
index 1f6057f..806323c 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPRel.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPRel.java
@@ -148,6 +148,11 @@ public interface OLAPRel extends RelNode {
             if (parent instanceof OLAPRel) {
                 OLAPRel olapRel = (OLAPRel) parent;
                 this.parentContext = olapRel.getContext();
+                System.out.println("Parent: " + olapRel);
+            }
+            if (child instanceof OLAPRel) {
+                OLAPRel olapRel = (OLAPRel) child;
+                System.out.println(this.parentContext + " - " + olapRel.getContext() + "
- " + olapRel);
             }
             return super.visitChild(parent, ordinal, child, prefer);
         }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/query/src/main/java/org/apache/kylin/query/relnode/OLAPToEnumerableConverter.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPToEnumerableConverter.java
b/query/src/main/java/org/apache/kylin/query/relnode/OLAPToEnumerableConverter.java
index d18993c..9e26cb2 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPToEnumerableConverter.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPToEnumerableConverter.java
@@ -31,10 +31,12 @@ import org.apache.calcite.plan.RelOptCluster;
 import org.apache.calcite.plan.RelOptCost;
 import org.apache.calcite.plan.RelOptPlanner;
 import org.apache.calcite.plan.RelOptTable;
+import org.apache.calcite.plan.RelOptUtil;
 import org.apache.calcite.plan.RelTraitSet;
 import org.apache.calcite.rel.RelNode;
 import org.apache.calcite.rel.convert.ConverterImpl;
 import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.sql.SqlExplainLevel;
 import org.apache.kylin.metadata.realization.IRealization;
 import org.apache.kylin.query.routing.NoRealizationFoundException;
 import org.apache.kylin.query.routing.QueryRouter;
@@ -84,9 +86,11 @@ public class OLAPToEnumerableConverter extends ConverterImpl implements
Enumerab
         OLAPRel.RewriteImplementor rewriteImplementor = new OLAPRel.RewriteImplementor();
         rewriteImplementor.visitChild(this, getInput());
 
-        //        String dumpPlan = RelOptUtil.dumpPlan("", this, false, SqlExplainLevel.DIGEST_ATTRIBUTES);
-        //        System.out.println("============================================================================");
-        //        System.out.println(dumpPlan);
+        if (System.getProperty("calcite.debug") != null) {
+            String dumpPlan = RelOptUtil.dumpPlan("", this, false, SqlExplainLevel.DIGEST_ATTRIBUTES);
+            System.out.println("EXECUTION PLAN AFTER REWRITE");
+            System.out.println(dumpPlan);
+        }
 
         // build java implementation
         EnumerableRel child = (EnumerableRel) getInput();

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/dc878ac3/query/src/test/java/org/apache/kylin/query/test/KylinTestBase.java
----------------------------------------------------------------------
diff --git a/query/src/test/java/org/apache/kylin/query/test/KylinTestBase.java b/query/src/test/java/org/apache/kylin/query/test/KylinTestBase.java
index 55699d3..819d2f9 100644
--- a/query/src/test/java/org/apache/kylin/query/test/KylinTestBase.java
+++ b/query/src/test/java/org/apache/kylin/query/test/KylinTestBase.java
@@ -423,7 +423,7 @@ public class KylinTestBase {
         int count = executeQuery(sql, true);
 
         if (debug) {
-            System.clearProperty("optiq.debug");
+            System.clearProperty("calcite.debug");
         }
         return count;
     }


Mime
View raw message