计数雅典娜桌的全部分区

发布于 2025-02-12 18:56:33 字数 187 浏览 1 评论 0原文

我的雅典娜和雅典娜冰山桌由多列划分。我想在Python脚本中创建一个逻辑,以破坏数据,如果有100多个分区以插入数据而没有错误。

显示分区table_name列出了所有分区,但我需要为它们计数。 我需要它是通用的

。 >但它行不通。

有解决方法吗?

I have Athena and Athena Iceberg tables partitioned by multiple columns. I want to create a logic in Python script to break data if have more than 100 total partitions to insert the data without errors.

SHOW PARTITIONS table_name lists all the partitions but I need the count for them. I need it to be generic to get the count for any table.

I tried select count(*) from information_schema.__internal_partitions__ WHERE table_schema = 'db_name' AND table_name = 'table_name' but it doesn't work.

Any workarounds?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

染年凉城似染瑾 2025-02-19 18:56:33

这适用于Athena Engine V2:

SELECT count(*) from "table_name$partitions"  

This works for Athena Engine V2:

SELECT count(*) from "table_name$partitions"  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文