hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Etienne Dumoulin <etienne.dumou...@idiro.com>
Subject Select dynamically a partition in an external table
Date Fri, 07 Sep 2012 18:54:08 GMT
Hi,

I have an external table partitioned per day, I have currently one
partition.

When I launch:

SELECT max(day) from MY_EXTERNAL_TABLE GROUP BY DAY;

It returns nothing.

I would like to use this query to select a partition dynamically:

  SELECT ID,
                 PROPERTY
    FROM MY_EXTERNAL_TABLE
    WHERE day IN (
            SELECT max(day)
            FROM MY_EXTERNAL_TABLE
            WHERE day <= '2012-09-07'
            GROUP BY DAY
        )

Do I do something wrong?
Is there a way around?

Thanks,

√Čtienne

Mime
View raw message