FAQ
Gotcha. Thanks for the info.

On Thu, Dec 19, 2013 at 5:45 PM, Alex Behm wrote:

Hi Keith,

you are correct. Impala versions below 1.2.2 have that limitation due to
the OR condition.

This particular issue has been fixed in Impala 1.2.2.

If you don't want to upgrade, one option is to rewrite the query using a
UNION as follows:

select * from foo where b=1 and c=1 union all select * from foo where b=2
and c=2

Cheers,

Alex

On Thu, Dec 19, 2013 at 5:33 PM, wrote:

I've noticed the query planner does not prune partitions correctly when
the query is written as follows:

select * from foo where ((partition_field_a = 1 and partition_field_b =
1) or (partition_field_a = 2 and partition_field_b = 2));

To make this more concrete, take the following table and insert
statements:

create table foo(a int) partitioned by (b int, c int) stored as
parquetfile;

insert into foo(a,b,c) (1,1,1)
insert into foo(a,b,c) (2,2,2)
insert into foo(a,b,c) (3,3,3)


If I then issue the following query, it will not prune any partitions:

select * from foo where ((b = 1 and c = 1) or (b = 2 and c = 2));


Is this expected behavior or a bug? If it's expected, how should I
rewrite this logic?

Keith

To unsubscribe from this group and stop receiving emails from it, send an
email to impala-user+unsubscribe@cloudera.org.
To unsubscribe from this group and stop receiving emails from it, send an
email to impala-user+unsubscribe@cloudera.org.
To unsubscribe from this group and stop receiving emails from it, send an email to impala-user+unsubscribe@cloudera.org.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupimpala-user @
categorieshadoop
postedDec 20, '13 at 1:45a
activeDec 20, '13 at 1:46a
posts2
users2
websitecloudera.com
irc#hadoop

2 users in discussion

Keith Simmons: 1 post Alex Behm: 1 post

People

Translate

site design / logo © 2021 Grokbase