Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Impala where xxx in () list operator not working correctly

avatar
Expert Contributor

Hi,

running a simple query where in the WHERE condition is a column IN ( ) condition and the list contains 13 elements (numbers).

The column is type of int.

Every time I run a query I got a different result, sometimes 5 rows, sometimes 2 rows, sometimes 10 rows. 

 

Of course I checked ID by ID that all elements are in the table...

 

is this a known bug or I am missing something?

 

select * from tmp_ext_item where item_id in ( 3040607, 5645020, 69772482, 2030547, 1753459, 9972822, 1846553, 6098104, 1874789, 1834370, 1829598, 1779239, 7932306 )

 

T.

 

 

 

1 ACCEPTED SOLUTION

avatar
Expert Contributor

During my test I came to one (maybe not correct) conclusion.

The table is big and partitioned, and maybe Impala just limits the query to a subset of a table. 

Because if I change the query like 

create table result as

select * from tmp_ext_item where item_id in ( 3040607, 5645020, 69772482, 2030547, 1753459, 9972822, 1846553, 6098104, 1874789, 1834370, 1829598, 1779239, 7932306 )

 

then it runs correctly and returns all items with the specified item_id.

 

 

View solution in original post

1 REPLY 1

avatar
Expert Contributor

During my test I came to one (maybe not correct) conclusion.

The table is big and partitioned, and maybe Impala just limits the query to a subset of a table. 

Because if I change the query like 

create table result as

select * from tmp_ext_item where item_id in ( 3040607, 5645020, 69772482, 2030547, 1753459, 9972822, 1846553, 6098104, 1874789, 1834370, 1829598, 1779239, 7932306 )

 

then it runs correctly and returns all items with the specified item_id.