You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2015/08/18 00:00:33 UTC

[03/50] [abbrv] hive git commit: HIVE-11436: CBO: Calcite Operator To Hive Operator (Calcite Return Path) : dealing with empty char (Pengcheng Xiong, reviewed by Jesus Camacho Rodriguez)

HIVE-11436: CBO: Calcite Operator To Hive Operator (Calcite Return Path) : dealing with empty char (Pengcheng Xiong, reviewed by Jesus Camacho Rodriguez)


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

Branch: refs/heads/hbase-metastore
Commit: 0b38612f6aede1b2e87b4a3f466f27ebf3612d1e
Parents: 5abcc6a
Author: Pengcheng Xiong <px...@hortonworks.com>
Authored: Mon Aug 10 12:42:17 2015 +0300
Committer: Jesus Camacho Rodriguez <jc...@apache.org>
Committed: Mon Aug 10 12:42:17 2015 +0300

----------------------------------------------------------------------
 .../calcite/translator/ExprNodeConverter.java     | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/0b38612f/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java
index b6a79db..00bf009 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ExprNodeConverter.java
@@ -225,23 +225,9 @@ public class ExprNodeConverter extends RexVisitorImpl<ExprNodeDesc> {
     case DECIMAL:
       return new ExprNodeConstantDesc(TypeInfoFactory.getDecimalTypeInfo(lType.getPrecision(),
           lType.getScale()), HiveDecimal.create((BigDecimal)literal.getValue3()));
-    case VARCHAR: {
-      int varcharLength = lType.getPrecision();
-      // If we cannot use Varchar due to type length restrictions, we use String
-      if (varcharLength < 1 || varcharLength > HiveVarchar.MAX_VARCHAR_LENGTH) {
-        return new ExprNodeConstantDesc(TypeInfoFactory.stringTypeInfo, literal.getValue3());
-      }
-      return new ExprNodeConstantDesc(TypeInfoFactory.getVarcharTypeInfo(varcharLength),
-          new HiveVarchar((String) literal.getValue3(), varcharLength));
-    }
+    case VARCHAR:
     case CHAR: {
-      int charLength = lType.getPrecision();
-      // If we cannot use Char due to type length restrictions, we use String
-      if (charLength < 1 || charLength > HiveChar.MAX_CHAR_LENGTH) {
-        return new ExprNodeConstantDesc(TypeInfoFactory.stringTypeInfo, literal.getValue3());
-      }
-      return new ExprNodeConstantDesc(TypeInfoFactory.getCharTypeInfo(charLength),
-          new HiveChar((String) literal.getValue3(), charLength));
+      return new ExprNodeConstantDesc(TypeInfoFactory.stringTypeInfo, literal.getValue3());
     }
     case INTERVAL_YEAR_MONTH: {
       BigDecimal monthsBd = (BigDecimal) literal.getValue();