You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Eric Lin <er...@cloudera.com> on 2017/04/15 11:52:00 UTC

Re: Review Request 57009: HIVE-16029 - COLLECT_SET and COLLECT_LIST does not return NULL in the result


> On Feb. 24, 2017, 4:08 p.m., Aihua Xu wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFMkCollectionEvaluator.java
> > Line 118 (original)
> > <https://reviews.apache.org/r/57009/diff/1/?file=1646634#file1646634line118>
> >
> >     I just checked the java. Seems java set doesn't include null. Let's ask Chao for the opinion since he worked on that fix.

Attached new patch to maintain original behaviour


- Eric


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


On Feb. 24, 2017, 1:01 a.m., Eric Lin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/57009/
> -----------------------------------------------------------
> 
> (Updated Feb. 24, 2017, 1:01 a.m.)
> 
> 
> Review request for hive and Aihua Xu.
> 
> 
> Bugs: HIVE-16029
>     https://issues.apache.org/jira/browse/HIVE-16029
> 
> 
> Repository: hive-git
> 
> 
> Description
> -------
> 
> See the test case below:
> 
> {code}
> 0: jdbc:hive2://localhost:10000/default> select * from collect_set_test;
> +---------------------+
> | collect_set_test.a  |
> +---------------------+
> | 1                   |
> | 2                   |
> | NULL                |
> | 4                   |
> | NULL                |
> +---------------------+
> 
> 0: jdbc:hive2://localhost:10000/default> select collect_set(a) from collect_set_test;
> +---------------+
> |      _c0      |
> +---------------+
> | [1,2,4]  |
> +---------------+
> 
> {code}
> 
> The correct result should be:
> 
> {code}
> 0: jdbc:hive2://localhost:10000/default> select collect_set(a) from collect_set_test;
> +---------------+
> |      _c0      |
> +---------------+
> | [1,2,null,4]  |
> +---------------+
> {code}
> 
> 
> Diffs
> -----
> 
>   ql/src/java/org/apache/hadoop/hive/ql/udf/generic/GenericUDAFMkCollectionEvaluator.java 2b5e6dd 
> 
> 
> Diff: https://reviews.apache.org/r/57009/diff/1/
> 
> 
> Testing
> -------
> 
> Manully tested and confirmed result is correct:
> 
> {code}
> 0: jdbc:hive2://localhost:10000/default> select collect_set(a) from collect_set_test;
> +---------------+
> |      _c0      |
> +---------------+
> | [1,2,null,4]  |
> +---------------+
> {code}
> 
> 
> Thanks,
> 
> Eric Lin
> 
>