hive 配置单元分析异常:无法识别“create”“table”附近的输入

xkrw2x1b  于 2023-01-20  发布在  Hive
关注(0)|答案(1)|浏览(683)

我正在尝试执行表单的配置单元查询

with (
select a,b from some_db.some_table
) as my_subquery

create table some_other_db.new_table as select * from my_subquery

我得到的错误

cannot recognize input near 'create' 'table' 'some_other_db' in statement

如何解决?

6kkfgxo0

6kkfgxo01#

问题是在配置单元中,不能在with语句之后包含create语句。它们必须在with语句之前。
以下查询有效:

create table some_other_db.new_table as 
with (
select a,b from some_db.some_table
) as my_subquery

select * from my_subquery

相关问题