calcite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcama...@apache.org
Subject incubator-calcite git commit: [CALCITE-918] createProject in RelOptUtil should uniquify field names
Date Tue, 13 Oct 2015 09:25:29 GMT
Repository: incubator-calcite
Updated Branches:
  refs/heads/master b1e91e1e6 -> 13f6efddf


[CALCITE-918] createProject in RelOptUtil should uniquify field names

Close apache/incubator-calcite#147


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

Branch: refs/heads/master
Commit: 13f6efddf350ee87699c767d6d949563f02208b2
Parents: b1e91e1
Author: Jesus Camacho Rodriguez <jcamacho@apache.org>
Authored: Mon Oct 12 18:26:57 2015 +0100
Committer: Jesus Camacho Rodriguez <jcamacho@apache.org>
Committed: Tue Oct 13 10:17:38 2015 +0100

----------------------------------------------------------------------
 core/src/main/java/org/apache/calcite/plan/RelOptUtil.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-calcite/blob/13f6efdd/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
index 7be75b7..e008bbe 100644
--- a/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
+++ b/core/src/main/java/org/apache/calcite/plan/RelOptUtil.java
@@ -2863,12 +2863,9 @@ public abstract class RelOptUtil {
   public static RelNode createProject(final RelFactories.ProjectFactory factory,
       final RelNode child, final List<Integer> posList) {
     RelDataType rowType = child.getRowType();
-    if (Mappings.isIdentity(posList, rowType.getFieldCount())) {
-      return child;
-    }
     final List<String> fieldNames = rowType.getFieldNames();
     final RexBuilder rexBuilder = child.getCluster().getRexBuilder();
-    return factory.createProject(child,
+    return createProject(child,
         new AbstractList<RexNode>() {
           public int size() {
             return posList.size();
@@ -2888,7 +2885,7 @@ public abstract class RelOptUtil {
             final int pos = posList.get(index);
             return fieldNames.get(pos);
           }
-        });
+        }, true, factory);
   }
 
   /**


Mime
View raw message