Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

querying partitions in impala

avatar
Explorer

Hi

How can I make Impala  read only required partitions not all partitions

we are using the results from a sql query

 

Regards

Philip

1 ACCEPTED SOLUTION

avatar
Master Collaborator

Hello @Bluetruth 

 

Have you tried query like below? Here year is a partition it shows the name in the year 2010.

## select name from census where year=2010;

 

If you need data only from partition column use query like below:

## select <col-name> from <table-name>;

 

Regards,

Chethan YM

View solution in original post

2 REPLIES 2

avatar
Master Collaborator

Hello @Bluetruth 

 

Have you tried query like below? Here year is a partition it shows the name in the year 2010.

## select name from census where year=2010;

 

If you need data only from partition column use query like below:

## select <col-name> from <table-name>;

 

Regards,

Chethan YM

avatar
Explorer

Hi Chethan

 

Thanks for the reply

as per your examples

 

1. select name from census where year=2010;

This works fine ie it only queries the partition but our problem is when the condition is not a literal

like ='2010'

but when we try to dynamically retrieve the data like your second example

 

We are finding that the query scans the whole table not just the partition - ie takes much longer in larger tables