简体   繁体   English

如何在Hive表中更新?

[英]How to do update in Hive table?

I have a table in Hive I want update the value in one column. 我在Hive中有一张表格,我想更新一列中的值。 I know Hive will not support row level update. 我知道Hive将不支持行级更新。 There any other way achieve this? 还有其他方法可以做到这一点吗?

If so pls share the query with me. 如果是这样,请与我分享查询。

Thanks Venkat 感谢Venkat

hive supports insert,update and delete from hive0.14 or hive支持从hive0.14插入,更新和删除,或

otherwise use case statements to achieve your update 否则,使用用case语句来完成更新

for example if col3 needs to be udpated 例如,如果col3需要加胶

Insert overwrite table tablename
select col1,col2,
case when condition then value else value end as col3 
from tablename

As of Hive version 0.14.0: INSERT VALUES, UPDATE, and DELETE are now available with full ACID support 从Hive版本0.14.0开始:INSERT VALUES,UPDATE和DELETE现在可提供完整的ACID支持

UPDATE Syntax: UPDATE语法:

UPDATE tablename SET column = value [, column = value ...] [WHERE expression]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM