calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jh...@apache.org
Subject [7/7] incubator-calcite git commit: [CALCITE-757] Fix expansion of view of another view (Venki Korukanti)
Date Sat, 13 Jun 2015 00:38:11 GMT
[CALCITE-757] Fix expansion of view of another view (Venki Korukanti)

Pass ViewExpanderImpl to SqlToRelConverter so that a view of another view is expanded properly.

The issue was found in [DRILL-1145].

Close apache/incubator-calcite#94


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

Branch: refs/heads/master
Commit: 468a161bbd8fd4994085d96e2bc801209a17cf76
Parents: 2b21765
Author: vkorukanti <venki.korukanti@gmail.com>
Authored: Fri Jun 5 11:02:46 2015 -0700
Committer: Julian Hyde <jhyde@apache.org>
Committed: Fri Jun 12 00:15:47 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/calcite/prepare/PlannerImpl.java   | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/468a161b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java
index f39ab2c..1c67178 100644
--- a/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java
+++ b/core/src/main/java/org/apache/calcite/prepare/PlannerImpl.java
@@ -218,11 +218,18 @@ public class PlannerImpl implements Planner {
       final RexBuilder rexBuilder = createRexBuilder();
       final RelOptCluster cluster = RelOptCluster.create(planner, rexBuilder);
       final SqlToRelConverter sqlToRelConverter =
-          new SqlToRelConverter(null, validator, catalogReader, cluster,
-              convertletTable);
+          new SqlToRelConverter(new ViewExpanderImpl(), validator,
+              catalogReader, cluster, convertletTable);
+
       sqlToRelConverter.setTrimUnusedFields(false);
+      sqlToRelConverter.enableTableAccessConversion(false);
+
+      RelNode rel =
+          sqlToRelConverter.convertQuery(validatedSqlNode, true, false);
+      rel = sqlToRelConverter.flattenTypes(rel, true);
+      rel = RelDecorrelator.decorrelateQuery(rel);
 
-      return sqlToRelConverter.convertQuery(validatedSqlNode, true, false);
+      return rel;
     }
   }
 


Mime
View raw message