> On May 11, 2018, 8:51 p.m., Bharathkrishna Guruvayoor Murali wrote: > > Should I handle String inputs like 2018-05-10 12:20:10 to retain the time > > part. > > I did not do this because the inputs can have several formats if it is > > String (whereas timestamp is only in one format and it was easier to > > handle). > > > > Should I add an extra parameter in the UDF that accepts an optional > > DateFormat string, where user can pass the format they want the output to > > be in. If the parser fails, I can fallback to the default format. > > What are your thoughts on this.
I think using the approach we see in GenericUDFDateFormat we will have consistent behaviour across different UDF-s. What do you think? - Peter ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/67073/#review202965 ----------------------------------------------------------- On May 10, 2018, 9:55 p.m., Bharathkrishna Guruvayoor Murali wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/67073/ > ----------------------------------------------------------- > > (Updated May 10, 2018, 9:55 p.m.) > > > Review request for hive, Peter Vary, Sahil Takiar, and Vihang Karajgaonkar. > > > Repository: hive-git > > > Description > ------- > > Adding support to retain the time part (HH:mm:ss) for add_months UDF when the > input is given as timestamp format. > > > Diffs > ----- > > common/src/java/org/apache/hive/common/util/DateUtils.java > 65f3b9401916abdfa52fbf75d115ba6b61758fb0 > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFAddMonths.java > dae4b97b4a17e98122431e5fda655fd9f873fdb5 > > ql/src/test/org/apache/hadoop/hive/ql/udf/generic/TestGenericUDFAddMonths.java > af9b6c43c7dafc69c4944eab02894786af306f35 > > > Diff: https://reviews.apache.org/r/67073/diff/1/ > > > Testing > ------- > > Added unit tests. > > > Thanks, > > Bharathkrishna Guruvayoor Murali > >