FAQ
Repository: hive
Updated Branches:
   refs/heads/master 5abcc6a27 -> 0b38612f6


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/master
Commit: 0b38612f6aede1b2e87b4a3f466f27ebf3612d1e
Parents: 5abcc6a
Author: Pengcheng Xiong <pxiong@hortonworks.com>
Authored: Mon Aug 10 12:42:17 2015 +0300
Committer: Jesus Camacho Rodriguez <jcamacho@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();

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedAug 10, '15 at 9:43a
activeAug 10, '15 at 9:43a
posts1
users1
websitehive.apache.org

1 user in discussion

Jcamacho: 1 post

People

Translate

site design / logo © 2022 Grokbase