Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我主要使用 presto 和 hive 连接器来连接到 hive 元存储。
我所有的表都是指向存储在 S3 中的数据的外部表。
我的主要问题是没有办法(至少我知道)在 Presto 中进行分区发现,所以在我开始查询 presto 表之前,我需要切换到 hive 并运行msck repair table mytable
msck repair table mytable
在 Presto 中有更合理的方法吗?
我使用的是 0.227 版本,以下对我有帮助:
select * from hive.yourschema."yourtable$partitions"
此选择返回目录中映射的所有分区。您可以像普通查询一样进行过滤、排序等。
不。
如果 HIVE 元存储看不到分区,PrestoDB 将看不到它。
也许一个cron可以帮助你。
现在有一种方法可以做到这一点:
CALL system.sync_partition_metadata(schema_name=>'<your-schema>', table_name=>'<your-table>', mode=>'FULL')
归功于这篇文章和这段视频