Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # dev >> Review Request 15113: HIVE-5356: Move arithmatic UDFs to generic UDF implementations


Copy link to this message
-
Re: Review Request 15113: HIVE-5356: Move arithmatic UDFs to generic UDF implementations

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/15113/#review28904
-----------------------------------------------------------

ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java
<https://reviews.apache.org/r/15113/#comment55971>

    This part is still incorrect for decimal types, see the following result types below, add/sub/mult is wrong when the precision/scale match.
    
                        expr: c1
                        type: decimal(10,2)
                        expr: c2
                        type: decimal(6,3)
                        expr: (c1 + c1)
                        type: decimal(10,2)
                        expr: (c1 + c2)
                        type: decimal(12,3)
                        expr: (c1 - c1)
                        type: decimal(10,2)
                        expr: (c1 - c2)
                        type: decimal(12,3)
                        expr: (c1 * c1)
                        type: decimal(10,2)
                        expr: (c1 * c2)
                        type: decimal(17,5)
                        expr: (c1 / c1)
                        type: decimal(23,13)
                        expr: (c1 / c2)
                        type: decimal(20,9)
    
This is looking good, just the one issue about result precision/scale when both left/right operands are the same.

- Jason Dere
On Nov. 14, 2013, 8:44 p.m., Xuefu Zhang wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15113/
> -----------------------------------------------------------
>
> (Updated Nov. 14, 2013, 8:44 p.m.)
>
>
> Review request for hive.
>
>
> Bugs: HIVe-5356
>     https://issues.apache.org/jira/browse/HIVe-5356
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> Replace plus, minus, and so on 6 old UDFs with generic UDF implementations.
>
>
> Diffs
> -----
>
>   common/src/test/org/apache/hadoop/hive/common/type/TestHiveDecimal.java e3a1620
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 5eb321c
>   ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java 7c1ab0d
>   ql/src/java/org/apache/hadoop/hive/ql/parse/TypeCheckProcFactory.java 7838547
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFBaseNumericOp.java 1e74fce
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPDivide.java b892b84
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMinus.java 0996231
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMod.java 0942ac3
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPMultiply.java 07c1957
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFOPPlus.java cfe7b2b
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFPosMod.java 0da7eae
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFBaseNumeric.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPDivide.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMinus.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMod.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPMultiply.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFOPPlus.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFPosMod.java PRE-CREATION
>   ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorSelectOperator.java 4aeb4e6
>   ql/src/test/org/apache/hadoop/hive/ql/exec/vector/TestVectorizationContext.java 3f3e67f
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFOPDivide.java 659d65f
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFOPMod.java 4c2e722
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFPosMod.java 2a301bc
>   ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFOPDivide.java PRE-CREATION