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/b91bf072 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b91bf072 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b91bf072 Branch: refs/heads/llap Commit: b91bf072bf17e6f069b8667fd79f58718d7a62ba Parents: ed648ab Author: Hari Subramaniyan <harisan...@apache.org> Authored: Wed Aug 5 14:04:41 2015 -0700 Committer: Hari Subramaniyan <harisan...@apache.org> Committed: Wed Aug 5 14:04:41 2015 -0700 ---------------------------------------------------------------------- .../hive/ql/optimizer/calcite/translator/ExprNodeConverter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/b91bf072/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 955aa91..b6a79db 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 @@ -44,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.HiveIntervalDayTime; import org.apache.hadoop.hive.common.type.HiveIntervalYearMonth; import org.apache.hadoop.hive.common.type.HiveVarchar; @@ -223,7 +224,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: { int varcharLength = lType.getPrecision(); // If we cannot use Varchar due to type length restrictions, we use String