当前位置:   article > 正文

Hive 中 insert into 与with as连用_insert into with

insert into with

写法如下,注意insert into的位置

with a as (select * from few_ints where x = 2)
insert
into few_ints
select *
from a;
  • 1
  • 2
  • 3
  • 4
  • 5

如下写法是会报错的

insert into few_ints
with a as (select * from few_ints where x = 2)
select *
from a;
  • 1
  • 2
  • 3
  • 4

报错信息如下

org.apache.hadoop.hive.ql.parse.ParseException:
line 2:0 cannot recognize input near 'with' 'a' 'as' in statement
  • 1
  • 2

参考

Hive踩过的坑-Hive的insert与with as 语句搭配 – 记忆角落

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/942465
推荐阅读
相关标签
  

闽ICP备14008679号