Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how the presto shows partitions before presto execute hql?

Tags:

hive

presto

trino

I used pyhive to connect hive to use Presto.

May I know the partitions of the hive tables before presto has executed the sql?

like image 205
user3065606 Avatar asked Dec 18 '22 08:12

user3065606


1 Answers

You can use the below presto query to get partitions.

presto> select * from db_name."table_name$partitions";
p_regionkey 
-------------
       1 
       2 
       3 

The result of SHOW PARTITIONS on hive is below.

hive> show partitions table_name;
p_regionkey=1
p_regionkey=2
p_regionkey=3

SHOW PARTITIONS on presto was removed on 0.209. https://trino.io/docs/current/release/release-0.209.html

like image 160
ebyhr Avatar answered Jan 02 '23 12:01

ebyhr