0
点赞
收藏
分享

微信扫一扫

【大数据】Hive-insert into table 与 insert overwrite table 区别

北冥有一鲲 2022-05-06 阅读 61

Hive-insert into table 与 insert overwrite table 区别

1、insert into 语句

Hive> insert into table account select id,age,name from account_tmp;

2、insert overwrite 语句

hive> insert overwrite table account2 select id,age,name from account_tmp;

也就是说 overwrite 会覆盖现有的数据,而 into 是直接将数据写入库。

如果需要的是去重的数据,那么应该选择 overwrite 作为插入的方式。

举报

相关推荐

0 条评论