gpt4 book ai didi

hadoop - 在 Hive 中, "Load data local inpath"是覆盖现有数据还是追加?

转载 作者:可可西里 更新时间:2023-11-01 14:19:03 29 4
gpt4 key购买 nike

我希望在 cron 上运行到 Hive 的导入,并且希望只使用

“将数据本地输入路径‘/tmp/data/x’加载到表 X”到表中就足够了。

后续命令会覆盖表中已有的内容吗?还是会追加?

最佳答案

本站http://wiki.apache.org/hadoop/Hive/LanguageManual在处理 Hive 时是你的 friend 。 :)

解决将数据加载到 Hive 的页面是 http://wiki.apache.org/hadoop/Hive/LanguageManual/DML该页面指出

if the OVERWRITE keyword is used then the contents of the target table (or partition) will be deleted and replaced with the files referred to by filepath. Otherwise the files referred by filepath will be added to the table. Note that if the target table (or partition) already has a file whose name collides with any of the filenames contained in filepath - then the existing file will be replaced with the new file.

在您的例子中,您没有使用 OVERWRITE 关键字,因此文件将被添加到表中。 (除非它们是相同的文件,在这种情况下它们会被覆盖)

关于hadoop - 在 Hive 中, "Load data local inpath"是覆盖现有数据还是追加?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5545357/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com