hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Pivovarov" <apivova...@gmail.com>
Subject Re: Review Request 32489: HIVE-9518 Implement MONTHS_BETWEEN aligned with Oracle one
Date Tue, 31 Mar 2015 20:08:38 GMT

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

(Updated March 31, 2015, 8:08 p.m.)


Review request for hive and Jason Dere.


Changes
-------

The function should support both short date and full timestamp string format and it should
not skip time part.
String lenght can not be used to determine the format because year might be less that 4 chars
and day and month can be just 1 char

This is why I decided to use both Timestamp and Date converters to convert input value to
java Date.
I also removed the fix I did before to GenericUDF which consider string lenght (str.length==10)

I added tests for dates without day, dates with partial time (no seconds) and dates with short
year, month and day.

Now string Dates parsing behavious shold be consistend with other UDFs (e.g. datediff)


Bugs: HIVE-9518
    https://issues.apache.org/jira/browse/HIVE-9518


Repository: hive-git


Description
-------

HIVE-9518 Implement MONTHS_BETWEEN aligned with Oracle one


Diffs (updated)
-----

  ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java 2476e832b8b7101971ea2226368aa82633b7e7d1

  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDF.java ce981232382e993c7c9d640efe9b2d21f70a0ed4

  ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFMonthsBetween.java PRE-CREATION

  ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFMonthsBetween.java PRE-CREATION

  ql/src/test/queries/clientpositive/udf_months_between.q PRE-CREATION 
  ql/src/test/results/clientpositive/show_functions.q.out 22091d06241218a5c0ee21d6ee6be00a71706971

  ql/src/test/results/clientpositive/udf_months_between.q.out PRE-CREATION 

Diff: https://reviews.apache.org/r/32489/diff/


Testing
-------


Thanks,

Alexander Pivovarov


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message