英文:
Hive. Does ALTER TABLE tablename CHANGE name1 name2 newdatatype; Remove the underline data for name1?
问题
这可能与一些在线教程中的解释不同。我在运行ALTER TABLE tablename CHANGE name1 name2 newdatatype;之后找到的。下划线数据被删除了吗?有人可以帮助理解这个命令是否会删除数据,而不仅仅是重命名列吗?
英文:
This may differ from the explanation for some online tutorial. That I found after I run ALTER TABLE tablename CHANGE name1 name2 newdatatype; The underline data is removed? Can someone help understand if this command will wipe out the data rather than just rename the column?
答案1
得分: 1
列更改命令只会修改Hive的元数据,不会修改数据。用户应确保表/分区的实际数据布局与元数据定义相符。
我认为修改列名或数据类型不会移除数据,可能有其他进程正在清除数据,或者可能有其他并行用户。
英文:
As per the documentation :
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-RulesforColumnNames
> The column change command will only modify Hive's metadata, and will
> not modify data. Users should make sure the actual data layout of the
> table/partition conforms with the metadata definition.
I don't think altering the column name or datatype would have removed the data, there might be some other process which is wiping the data or may be some parallel user.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论