You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by rh...@apache.org on 2014/09/16 23:09:53 UTC
svn commit: r1625392 -
/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/reloperators/HiveProjectRel.java
Author: rhbutani
Date: Tue Sep 16 21:09:53 2014
New Revision: 1625392
URL: http://svn.apache.org/r1625392
Log:
HIVE-8144 CBO: HiveProjectRel factory should create RelSubSets (Harish Butani via Ashutosh Chauhan)
Modified:
hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/reloperators/HiveProjectRel.java
Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/reloperators/HiveProjectRel.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/reloperators/HiveProjectRel.java?rev=1625392&r1=1625391&r2=1625392&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/reloperators/HiveProjectRel.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/optiq/reloperators/HiveProjectRel.java Tue Sep 16 21:09:53 2014
@@ -95,6 +95,14 @@ public class HiveProjectRel extends Proj
}
/**
+ * Creates a HiveProjectRel.
+ */
+ public static HiveProjectRel create(RelOptCluster cluster, RelNode child, List<? extends RexNode> exps,
+ RelDataType rowType, RelTraitSet traitSet, final List<RelCollation> collationList) {
+ return new HiveProjectRel(cluster, traitSet, child, exps, rowType, Flags.BOXED);
+ }
+
+ /**
* Creates a relational expression which projects the output fields of a
* relational expression according to a partial mapping.
*
@@ -175,10 +183,12 @@ public class HiveProjectRel extends Proj
@Override
public RelNode createProject(RelNode child,
List<? extends RexNode> childExprs, List<String> fieldNames) {
- RelNode project = HiveProjectRel.create(child, childExprs, fieldNames);
+ RelOptCluster cluster = child.getCluster();
+ RelDataType rowType = RexUtil.createStructType(cluster.getTypeFactory(), childExprs, fieldNames);
+ RelNode project = HiveProjectRel.create(cluster, child,
+ childExprs, rowType,
+ child.getTraitSet(), Collections.<RelCollation> emptyList());
- // Make sure extra traits are carried over from the original rel
- project = RelOptRule.convert(project, child.getTraitSet());
return project;
}
}