未选择用于增量统计更新的分区
当我在命令中没有分区子句的情况下运行 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的理解是正确的
PARTITION子句是可选的。
这是COMPUTE INCRMENTAL STATS
的正确行为。增量统计信息像往常一样收集统计信息,但如果它找到一个新分区,它会收集统计信息并显示它找到一个新分区的消息并为此收集统计信息。
当您第一次运行“计算增量统计 mytab”时,它将收集所有分区的所有统计信息,您将看到类似“更新了 4 个分区和 200 个列”的消息。 。
当您再次运行
COMPUTE INCRMENTAL STATS mytab
(不添加新分区)时,它找不到任何新分区来收集统计信息。因此,它将显示此消息没有选择用于增量统计更新的分区。
并收集现有数据的统计信息。Your understanding is correct
PARTITION clause is optional.
and this is correct behavior ofCOMPUTE 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 likeUpdated 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 messageNo partitions selected for incremental stats update.
and gather stats of existing data.