diff --git ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java index f2c5408..091d030 100644 --- ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java +++ ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java @@ -51,9 +51,10 @@ *

*/ public class HiveTableScan extends TableScan implements HiveRelNode { - private final RelDataType rowtype; + + private final RelDataType hiveTableScanRowType; private final ImmutableList neededColIndxsFrmReloptHT; - + /** * Creates a HiveTableScan. * @@ -74,7 +75,7 @@ private HiveTableScan(RelOptCluster cluster, RelTraitSet traitSet, RelOptHiveTab RelDataType newRowtype) { super(cluster, TraitsUtil.getDefaultTraitSet(cluster), table); assert getConvention() == HiveRelNode.CONVENTION; - this.rowtype = newRowtype; + this.hiveTableScanRowType = newRowtype; this.neededColIndxsFrmReloptHT = buildNeededColIndxsFrmReloptHT(table.getRowType(), newRowtype); } @@ -88,16 +89,17 @@ public RelNode copy(RelTraitSet traitSet, List inputs) { * Copy TableScan operator with a new Row Schema. The new Row Schema can only * be a subset of this TS schema. * - * @param rowtype + * @param newRowtype * @return */ public HiveTableScan copy(RelDataType newRowtype) { - return new HiveTableScan(getCluster(), getTraitSet(), ((RelOptHiveTable) table)); + return new HiveTableScan(getCluster(), getTraitSet(), ((RelOptHiveTable) table), + newRowtype); } @Override public RelDataType deriveRowType() { - return rowtype; + return hiveTableScanRowType; } @Override diff --git ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java index e0526d9..4970050 100644 --- ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java +++ ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java @@ -49,7 +49,6 @@ import org.apache.calcite.plan.hep.HepProgramBuilder; import org.apache.calcite.rel.InvalidRelException; import org.apache.calcite.rel.RelCollation; -import org.apache.calcite.rel.RelCollations; import org.apache.calcite.rel.RelCollationImpl; import org.apache.calcite.rel.RelCollations; import org.apache.calcite.rel.RelFieldCollation; @@ -1332,9 +1331,6 @@ private RelNode genTableLogicalPlan(String tableAlias, QB qb) throws SemanticExc else { fullyQualifiedTabName = tabMetaData.getTableName(); } - if (conf.getBoolVar(HiveConf.ConfVars.HIVE_CBO_RETPATH_HIVEOP)) { - fullyQualifiedTabName += "." + tableAlias; - } RelOptHiveTable optTable = new RelOptHiveTable(relOptSchema, fullyQualifiedTabName, tableAlias, rowType, tabMetaData, nonPartitionColumns, partitionColumns, virtualCols, conf, partitionCache, noColsMissingStats, getAliasId(tableAlias, qb));