未选择用于增量统计更新的分区

发布于 2025-01-12 20:15:36 字数 437 浏览 2 评论 0原文

当我在命令中没有分区子句的情况下运行 COMPUTE INCRMENTAL STATS 时,收到消息 Noparts selected for Incremental stats update。但该表是用某些列分区的。

根据文档此处计算增量统计[ db_name.]table_name [PARTITION (partition_spec)] PARTITION 子句是可选的。

然后我不明白为什么我会收到“未选择分区”的错误。是强制性的还是有任何不同的版本可用?请帮忙

Getting a message No partitions selected for incremental stats update when I run COMPUTE INCREMENTAL STATS <table_name> without partition clause in the command. But the table is partitioned with some column.

As per the documentation here COMPUTE INCREMENTAL STATS [db_name.]table_name [PARTITION (partition_spec)] PARTITION clause is optional.

then I don't understand why I'm getting an err that "No partitions selected". Is it mandatory or any different versions available ? Please help

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

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

发布评论

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

评论(1

歌入人心 2025-01-19 20:15:36

您的理解是正确的PARTITION子句是可选的。这是COMPUTE INCRMENTAL STATS的正确行为。
增量统计信息像往常一样收集统计信息,但如果它找到一个新分区,它会收集统计信息并显示它找到一个新分区的消息并为此收集统计信息。

当您第一次运行“计算增量统计 mytab”时,它将收集所有分区的所有统计信息,您将看到类似“更新了 4 个分区和 200 个列”的消息。 。
当您再次运行COMPUTE INCRMENTAL STATS mytab(不添加新分区)时,它找不到任何新分区来收集统计信息。因此,它将显示此消息没有选择用于增量统计更新的分区。并收集现有数据的统计信息。

Your understanding is correct PARTITION clause is optional. and this is correct behavior of COMPUTE INCREMENTAL STATS.
Incremental stats gather stats as usual but if it finds a new partition, it gather stats and show message that it found a new partition and gather stats for that.

When you run COMPUTE INCREMENTAL STATS mytab for the first time, it will gather all the stats of all partitions and you will see message like Updated 4 partition(s) and 200 column(s)..
When you run COMPUTE INCREMENTAL STATS mytab again (without adding new partition), it doesn't find any new partition to gather stats. So it will show this message No partitions selected for incremental stats update. and gather stats of existing data.

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