You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jc...@apache.org on 2015/10/13 11:25:29 UTC
incubator-calcite git commit: [CALCITE-918] createProject in
RelOptUtil should uniquify field names
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 <jc...@apache.org>
Authored: Mon Oct 12 18:26:57 2015 +0100
Committer: Jesus Camacho Rodriguez <jc...@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);
}
/**