hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jcama...@apache.org
Subject svn commit: r1670332 - in /hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql: optimizer/calcite/reloperators/HiveTableScan.java parse/CalcitePlanner.java
Date Tue, 31 Mar 2015 13:22:53 GMT
Author: jcamacho
Date: Tue Mar 31 13:22:52 2015
New Revision: 1670332

URL: http://svn.apache.org/r1670332
Log:
HIVE-10138 : CBO (Calcite Return Path): HiveTableScan copy does not take into account new
row schema [CBO Branch] (Jesus Camacho Rodriguez, reviewed by Laljo John Pullokkaran)

Modified:
    hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java
    hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java?rev=1670332&r1=1670331&r2=1670332&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java
(original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/reloperators/HiveTableScan.java
Tue Mar 31 13:22:52 2015
@@ -51,9 +51,10 @@ import com.google.common.collect.Immutab
  * </p>
  */
 public class HiveTableScan extends TableScan implements HiveRelNode {
-  private final RelDataType rowtype;
+
+  private final RelDataType hiveTableScanRowType;
   private final ImmutableList<Integer> neededColIndxsFrmReloptHT;
-  
+
   /**
    * Creates a HiveTableScan.
    *
@@ -74,7 +75,7 @@ public class HiveTableScan extends Table
       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 class HiveTableScan extends Table
    * 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
@@ -173,4 +175,4 @@ public class HiveTableScan extends Table
 
     return neededColIndxsFrmReloptHTBldr.build();
   }
-}
\ No newline at end of file
+}

Modified: hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java
URL: http://svn.apache.org/viewvc/hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java?rev=1670332&r1=1670331&r2=1670332&view=diff
==============================================================================
--- hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java (original)
+++ hive/branches/cbo/ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java Tue
Mar 31 13:22:52 2015
@@ -49,7 +49,6 @@ import org.apache.calcite.plan.hep.HepPr
 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 @@ public class CalcitePlanner extends Sema
         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));



Mime
View raw message