hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject [1/2] hive git commit: HIVE-10522 : CBO (Calcite Return Path): fix the wrong needed column names when TS is created (Pengcheng Xiong via John Pullokkaran)
Date Wed, 29 Apr 2015 20:47:37 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-1.2 b1d3dd495 -> 14c89028f
  refs/heads/master 8a1983dd5 -> e02be06f8


HIVE-10522 : CBO (Calcite Return Path): fix the wrong needed column names when TS is created
(Pengcheng Xiong via John Pullokkaran)

Signed-off-by: Ashutosh Chauhan <hashutosh@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/e02be06f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/e02be06f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/e02be06f

Branch: refs/heads/master
Commit: e02be06f80e4455f7441bb961bb1956d4efb868e
Parents: 8a1983d
Author: Pengcheng Xiong <pxiong@hortonworks.com>
Authored: Tue Apr 28 15:36:00 2015 -0700
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Wed Apr 29 13:46:21 2015 -0700

----------------------------------------------------------------------
 .../calcite/translator/HiveOpConverter.java     | 26 ++++++++++----------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/e02be06f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
index 85d1663..d266f64 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/HiveOpConverter.java
@@ -209,26 +209,26 @@ public class HiveOpConverter {
     String colName;
     ColumnInfo colInfo;
     VirtualColumn vc;
-    Integer posInRHT;
 
-    for (int i = 0; i < neededColIndxsFrmReloptHT.size(); i++) {
-      colName = scanColNames.get(i);
-      posInRHT = neededColIndxsFrmReloptHT.get(i);
-      if (VColsMap.containsKey(posInRHT)) {
-        vc = VColsMap.get(posInRHT);
+    for (int index = 0; index < scanRel.getRowType().getFieldList().size(); index++) {
+      colName = scanColNames.get(index);
+      if (VColsMap.containsKey(index)) {
+        vc = VColsMap.get(index);
         virtualCols.add(vc);
         colInfo = new ColumnInfo(vc.getName(), vc.getTypeInfo(), tableAlias, true, vc.getIsHidden());
-        vcolsInCalcite.add(posInRHT);
-      } else if (posToPartColInfo.containsKey(posInRHT)) {
+        vcolsInCalcite.add(index);
+      } else if (posToPartColInfo.containsKey(index)) {
         partColNames.add(colName);
-        colInfo = posToPartColInfo.get(posInRHT);
-        vcolsInCalcite.add(posInRHT);
+        colInfo = posToPartColInfo.get(index);
+        vcolsInCalcite.add(index);
       } else {
-        colInfo = posToNonPartColInfo.get(posInRHT);
+        colInfo = posToNonPartColInfo.get(index);
       }
-      neededColumnIDs.add(posInRHT);
-      neededColumnNames.add(colName);
       colInfos.add(colInfo);
+      if (neededColIndxsFrmReloptHT.contains(index)) {
+        neededColumnIDs.add(index);
+        neededColumnNames.add(colName);
+      }
     }
 
     // 1.2 Create TableScanDesc


Mime
View raw message