蜂巢: - 在截断表格上,在分区列上选择结果

发布于 2025-01-26 02:23:02 字数 387 浏览 3 评论 0原文

我在蜂巢中有一张桌子,该表在列上分区。 我截断了桌子,然后在上面做2个选择。

  1. 从表中选择计数(*),我将结果称为0。这是预期的。

但是,如果我在分区列上进行选择,我会得到结果,而不是我期望的空行。

Select distinct <paritition column> 
from table

结果:

partition value 1
partition value 2
......

我可以在HDF中看到分区文件夹仍然存在,尽管它们是空的。我希望元数据在截断后会更新。

我不确定为什么我会得到上述结果,

感谢任何帮助

I have a table in hive which is partitioned on a column.
I truncate the table and I do 2 selects on them.

  1. Select count(*) from table, I get the result as 0. Which is expected.

But If I do a select on the partition column, I get results instead of null rows which I expected.

Select distinct <paritition column> 
from table

Result:

partition value 1
partition value 2
......

I can see in hdfs that the partition folders still exists , though they are empty. I expected the metadata to get updated after I did the truncate.

I am not sure why I am getting the above result

Any help is appreciated

Thanks!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文