> On April 9, 2015, 8:34 p.m., Swarnim Kulkarni wrote: > > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDayOfYear.java, > > line 46 > > <https://reviews.apache.org/r/32732/diff/1/?file=912253#file912253line46> > > > > I have usually seen GenericUDFS been used in cases where we need to use > > complex types. Little confused on why can't we get by here with a regular > > UDF and have an implementation similar to the dayofmonth UDF? > > > > Or is there something that I am missing? > > > > [1] > > https://github.com/cloudera/hive/blob/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFDayOfMonth.java
The function supports date/timestamp/string as an input type. GenericUDF provides getDateValue method to get Date. It also validates is input is simple type and belong to STRING or DATE group. > On April 9, 2015, 8:34 p.m., Swarnim Kulkarni wrote: > > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDayOfYear.java, > > line 49 > > <https://reviews.apache.org/r/32732/diff/1/?file=912253#file912253line49> > > > > Move inside the evaluate method. The code repeats common code blocks from other recently added UDFs, e.g. GenericUDFAddMonths > On April 9, 2015, 8:34 p.m., Swarnim Kulkarni wrote: > > ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFDayOfYear.java, > > line 109 > > <https://reviews.apache.org/r/32732/diff/1/?file=912254#file912254line109> > > > > Why is this test commented out? because of HIVE-10178 committed to trunk 2 days ago. I'll add the test back - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/32732/#review79569 ----------------------------------------------------------- On April 1, 2015, 5:56 p.m., Alexander Pivovarov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/32732/ > ----------------------------------------------------------- > > (Updated April 1, 2015, 5:56 p.m.) > > > Review request for hive and Jason Dere. > > > Bugs: HIVE-3378 > https://issues.apache.org/jira/browse/HIVE-3378 > > > Repository: hive-git > > > Description > ------- > > HIVE-3378 UDF to obtain the numeric day of an year from date or timestamp in > HIVE > > > Diffs > ----- > > ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java > 2476e832b8b7101971ea2226368aa82633b7e7d1 > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFDayOfYear.java > PRE-CREATION > > ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFDayOfYear.java > PRE-CREATION > ql/src/test/queries/clientpositive/udf_dayofyear.q PRE-CREATION > ql/src/test/results/clientpositive/show_functions.q.out > 22091d06241218a5c0ee21d6ee6be00a71706971 > ql/src/test/results/clientpositive/udf_dayofyear.q.out PRE-CREATION > > Diff: https://reviews.apache.org/r/32732/diff/ > > > Testing > ------- > > > Thanks, > > Alexander Pivovarov > >