> On Feb. 11, 2015, 9:13 p.m., Vikram Dixit Kumaraswamy wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java,
> >  line 81
> > <https://reviews.apache.org/r/30788/diff/1/?file=858225#file858225line81>
> >
> >     Don't we need the null check still for the arguments array?
> >     
> >     arguments[1] != null

the code does not check arguments[0] for null. same way it does not need to 
check arguments[1] for null.
Number of arguments is always 2.
I looked at other UDFs implementations - they do not check arguments[n] for 
null as well.
So, arguments[n] is always not null. But arguments[n].get() might be null.

I did manual test where I pass null value to arguments[0] and arguments[1]
I should probably added null args tests to udf qtest file


- Alexander


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


On Feb. 11, 2015, 8:42 p.m., Alexander Pivovarov wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/30788/
> -----------------------------------------------------------
> 
> (Updated Feb. 11, 2015, 8:42 p.m.)
> 
> 
> Review request for hive, Jason Dere, Siying Dong, and Vikram Dixit 
> Kumaraswamy.
> 
> 
> Bugs: HIVE-9617
>     https://issues.apache.org/jira/browse/HIVE-9617
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> HIVE-9617 UDF from_utc_timestamp throws NPE if the second argument is null
> 
> 
> Diffs
> -----
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDFFromUtcTimestamp.java
>  f76fc104774cf77597d8467c9dcf3fe8d05cddce 
> 
> Diff: https://reviews.apache.org/r/30788/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alexander Pivovarov
> 
>

Reply via email to