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

Switch to Threaded View
Hive, mail # dev - Review Request 15213: HIVE-5731: Use new GenericUDF instead of basic UDF for UDFDate* classes


Copy link to this message
-
Re: Review Request 15213: HIVE-5731: Use new GenericUDF instead of basic UDF for UDFDate* classes
Ashutosh Chauhan 2013-11-25, 23:13

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

ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java
<https://reviews.apache.org/r/15213/#comment56632>

    Instead of converttoDate() and creating new Date() everytime, your earlier approach of getting DateWritable via converter and than obtaining Date from it via dw.get() was better, since new one requires creating new Date() everytime.

ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java
<https://reviews.apache.org/r/15213/#comment56631>

    Have this object result as a class member and then reuse that object across function call by doing result.set() on each invocation, that will help in object reuse and save new() on each function invocation.
- Ashutosh Chauhan
On Nov. 11, 2013, 9:03 p.m., Mohammad Islam wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/15213/
> -----------------------------------------------------------
>
> (Updated Nov. 11, 2013, 9:03 p.m.)
>
>
> Review request for hive.
>
>
> Bugs: HIVE-5731
>     https://issues.apache.org/jira/browse/HIVE-5731
>
>
> Repository: hive-git
>
>
> Description
> -------
>
> GenericUDF class is the latest and recommended base class for any UDFs.
> This JIRA is to change the current UDFDate* classes extended from GenericUDF.
>
>
> Diffs
> -----
>
>   ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 8d3a84f
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDate.java 3df453c
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDateAdd.java b1b0bf2
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDateDiff.java da14c4f
>   ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDateSub.java c8a1d1f
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDate.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateAdd.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateDiff.java PRE-CREATION
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDateSub.java PRE-CREATION
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestGenericUDFDate.java PRE-CREATION
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestGenericUDFDateAdd.java PRE-CREATION
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestGenericUDFDateDiff.java PRE-CREATION
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestGenericUDFDateSub.java PRE-CREATION
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFDateAdd.java f0af069
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFDateDiff.java 8a6dbc3
>   ql/src/test/org/apache/hadoop/hive/ql/udf/TestUDFDateSub.java fa722a9
>   ql/src/test/results/clientpositive/udf_to_date.q.out 6ff5ee8
>
> Diff: https://reviews.apache.org/r/15213/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Mohammad Islam
>
>