6

I'm using presto mainly with hive connector to connect to hive metastore.

All of my tables are external tables pointing to data stored in S3.

My main issue with this is that there is no way (at least on I'm aware of ) to do partition discovery in Presto ,so before I start query a table in presto I need to switch to hive and run msck repair table mytable

is there more reasonable way to do it in Presto?

Lior Baber
  • 852
  • 3
  • 11
  • 25

3 Answers3

5

I'm on version 0.227 and the following helps me:

select * from hive.yourschema."yourtable$partitions"

This select returns all the partitions mapped in your catalog. You can filter, order, etc. as a normal query would.

3

No.

If the HIVE metastore doesn't see the partitions, PrestoDB will not see it.

Maybe a cron can help you.

Damien Carol
  • 1,164
  • 1
  • 11
  • 21
  • 2
    Also, it looks like there is a cache between PrestoDB & Hive partition, I don't find anything about that but I always have to wait 2 minutes before running queries on Presto. – Thomas Decaux May 04 '17 at 13:29
0

There is now a way to do this:

CALL system.sync_partition_metadata(schema_name=>'<your-schema>', table_name=>'<your-table>', mode=>'FULL')

Credit to this post and this video

Lou Zell
  • 5,255
  • 3
  • 28
  • 23