You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/10/24 15:58:23 UTC

[03/12] kylin git commit: KYLIN-2930 make tablescan phy type always ARRAY

KYLIN-2930 make tablescan phy type always ARRAY


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

Branch: refs/heads/2.2.x
Commit: 227668a34343f28f2efb30c6bf8ec106bc6239ac
Parents: c21fe43
Author: Roger Shi <ro...@hotmail.com>
Authored: Tue Oct 10 15:04:46 2017 +0800
Committer: Roger Shi <ro...@hotmail.com>
Committed: Thu Oct 19 10:03:42 2017 +0800

----------------------------------------------------------------------
 kylin-it/src/test/resources/query/sql_union/query03.sql           | 1 +
 .../main/java/org/apache/kylin/query/relnode/OLAPTableScan.java   | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/227668a3/kylin-it/src/test/resources/query/sql_union/query03.sql
----------------------------------------------------------------------
diff --git a/kylin-it/src/test/resources/query/sql_union/query03.sql b/kylin-it/src/test/resources/query/sql_union/query03.sql
new file mode 100644
index 0000000..e92d8e0
--- /dev/null
+++ b/kylin-it/src/test/resources/query/sql_union/query03.sql
@@ -0,0 +1 @@
+select count(*) as cnt from TEST_KYLIN_FACT where TRANS_ID < 1000 union select count(*) as cnt from TEST_KYLIN_FACT where TRANS_ID > 9000
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/kylin/blob/227668a3/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
index 2ee4513..e9e3566 100644
--- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
+++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java
@@ -25,6 +25,7 @@ import java.util.Stack;
 
 import org.apache.calcite.adapter.enumerable.EnumerableRel;
 import org.apache.calcite.adapter.enumerable.EnumerableRelImplementor;
+import org.apache.calcite.adapter.enumerable.JavaRowFormat;
 import org.apache.calcite.adapter.enumerable.PhysType;
 import org.apache.calcite.adapter.enumerable.PhysTypeImpl;
 import org.apache.calcite.linq4j.tree.Blocks;
@@ -334,7 +335,7 @@ public class OLAPTableScan extends TableScan implements OLAPRel, EnumerableRel {
         context.setReturnTupleInfo(rowType, columnRowType);
         String execFunction = genExecFunc();
 
-        PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), this.rowType, pref.preferArray());
+        PhysType physType = PhysTypeImpl.of(implementor.getTypeFactory(), getRowType(), JavaRowFormat.ARRAY);
         MethodCallExpression exprCall = Expressions.call(table.getExpression(OLAPTable.class), execFunction,
                 implementor.getRootExpression(), Expressions.constant(context.id));
         return implementor.result(physType, Blocks.toBlock(exprCall));