[ 
https://issues.apache.org/jira/browse/HIVE-18999?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16415895#comment-16415895
 ] 

Steve Yeom commented on HIVE-18999:
-----------------------------------

GenericUDFIn.evaluate(DeferredObject[]) has 
..
175       case STRUCT: {
176         if (constantInSet.contains(((StructObjectInspector) 
compareOI).getStructFieldsDataAsList(conversionHelper
177            .convertIfNecessary(arguments[0].get(), argumentOIs[0])))) {
178           bw.set(true);
179           return bw;
180         }
181         break;
182       }

The case 1 get the "arguments[0].get()" converted to Text (or String) so that 
we get true
to have a correct result. Here "arguments[0].get()" is the left side node in 
where clause.
constantInSet has Text node. 
The case 3 has both constantInSet and arguments[0].get() has IntWritable to get 
a correct
result. 
The second case 2 has IntWritable for constantInSet and LongWritable for the 
other, which 
causes "constantInSet.contains(..)" to return false. 

A patch might be to convert left side LongWritable node to IntWritable .

> Filter operator does not work for List
> --------------------------------------
>
>                 Key: HIVE-18999
>                 URL: https://issues.apache.org/jira/browse/HIVE-18999
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 3.0.0
>            Reporter: Steve Yeom
>            Assignee: Steve Yeom
>            Priority: Major
>
> {code:sql}
> create table table1(col0 int, col1 bigint, col2 string, col3 bigint, col4 
> bigint);
> insert into table1 values (1, 10000, 'ccl',2014, 11);
> insert into table1 values (1, 10000, 'ccl',2015, 11);
> insert into table1 values (1, 10000, 'ccl',2014, 11);
> insert into table1 values (1, 10000, 'ccl',2013, 11);
> -- INCORRECT
> SELECT COUNT(t1.col0) from table1 t1 where struct(col3, col4) in 
> (struct(2014,11));
> -- CORRECT
> SELECT COUNT(t1.col0) from table1 t1 where struct(col3, col4) in 
> (struct('2014','11'));
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to