Repository: hive Updated Branches: refs/heads/branch-1 e9947776a -> eb7678b12
HIVE-11367 : CBO: Calcite Operator To Hive Operator (Calcite Return Path): ExprNodeConverter should use HiveDecimal to create Decimal (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/eb7678b1 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/eb7678b1 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/eb7678b1 Branch: refs/heads/branch-1 Commit: eb7678b12aea6f443d23837b8d528ac1d1e3cd99 Parents: e994777 Author: Hari Subramaniyan <harisan...@apache.org> Authored: Thu Aug 6 12:46:38 2015 -0700 Committer: Hari Subramaniyan <harisan...@apache.org> Committed: Thu Aug 6 12:46:38 2015 -0700 ---------------------------------------------------------------------- .../hive/ql/optimizer/calcite/translator/ExprNodeConverter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/eb7678b1/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 bcce74a..526d8be 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 @@ -17,6 +17,7 @@ */ package org.apache.hadoop.hive.ql.optimizer.calcite.translator; +import java.math.BigDecimal; import java.sql.Date; import java.sql.Timestamp; import java.util.ArrayList; @@ -43,6 +44,7 @@ import org.apache.calcite.sql.type.SqlTypeUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hive.common.type.HiveChar; +import org.apache.hadoop.hive.common.type.HiveDecimal; import org.apache.hadoop.hive.common.type.HiveVarchar; import org.apache.hadoop.hive.ql.exec.UDFArgumentException; import org.apache.hadoop.hive.ql.optimizer.calcite.translator.ASTConverter.RexVisitor; @@ -218,7 +220,7 @@ public class ExprNodeConverter extends RexVisitorImpl<ExprNodeDesc> { return new ExprNodeConstantDesc(TypeInfoFactory.binaryTypeInfo, literal.getValue3()); case DECIMAL: return new ExprNodeConstantDesc(TypeInfoFactory.getDecimalTypeInfo(lType.getPrecision(), - lType.getScale()), literal.getValue3()); + lType.getScale()), HiveDecimal.create((BigDecimal)literal.getValue3())); case VARCHAR: return new ExprNodeConstantDesc(TypeInfoFactory.getVarcharTypeInfo(lType.getPrecision()), new HiveVarchar((String) literal.getValue3(), lType.getPrecision()));