Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presto not able query Hive partition external table #12025

Closed
SivaSamrajS opened this issue Dec 6, 2018 · 7 comments
Closed

Presto not able query Hive partition external table #12025

SivaSamrajS opened this issue Dec 6, 2018 · 7 comments

Comments

@SivaSamrajS
Copy link

I have created the External table on hive from hadoop path with year and month partitions.
I have connected the hive with presto. I am able to query the data in hive, but the same table is not returning the data with presto(returning 0 rows).
Presto: 0.213
presto:retaildemov2> select * from customer; customer_id | account_num | lname | fname | mi | address1 | address2 | address3 | address4 | city | state_province | postal_code | country | customer_region_id | phone1 | phone2 | birthdate | marital_sta -------------+-------------+-------+-------+----+----------+----------+----------+----------+------+----------------+-------------+---------+--------------------+--------+--------+-----------+------------ (0 rows)

num_cars_owned | integer | | fullname | varchar | | event_ts | timestamp | | year | varchar | partition key | month | varchar | partition key |

@findepi
Copy link
Contributor

findepi commented Dec 6, 2018

When you create external table, you need to define all the partitions.
You can do this in Hive, by running msck repair table <table-name>;

@shlomialfasi
Copy link

Can the msck repair command run from Presto?

@SivaSamrajS
Copy link
Author

SivaSamrajS commented Dec 8, 2018 via email

@nezihyigitbasi
Copy link
Contributor

Can the msck repair command run from Presto?

No, it's a hive command.

@prabakarankrishnan
Copy link

I also facing same problem. MSCK repair I did. I am able to query in Hive. But still presto not able to access...

@yuzhu
Copy link
Contributor

yuzhu commented Jun 26, 2020

i have noticed that after msck repair, i needed to run a select query in hive before presto can pick up the change and show results for select queries.. no idea why though..

@friendofasquid
Copy link

Hello from 2021.

At some point, looks like Presto has added system.sync_partition_metadata which should remove the need to run msck repair in Hive / Spark / Athena.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants