简体   繁体   English

Hive ParseException:无法识别“创建”“表”附近的输入

[英]Hive ParseException: cannot recognize input near 'create' 'table'

I am trying to conduct a hive query of the form我正在尝试对表单进行蜂巢查询

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

create table some_other_db.new_table as select * from my_subquery

And I am getting the error我收到了错误

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

How do I resolve?我该如何解决?

The issue is in hive you cannot include create statements after a with statement.问题出在配置单元中,您不能在with语句之后包含create语句。 They need to be before.他们需要在之前。

The following query worked:以下查询有效:

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

select * from my_subquery

暂无
暂无

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

相关问题 Hive ParseException-无法识别Select子句中的输入 - Hive ParseException - cannot recognize input in Select Clause 配置单元查询失败:ParseException行无法识别select子句中&#39;(&#39;&#39;WITH&#39;&#39;DATA_SET&#39;附近的输入 - Hive Query FAILED: ParseException line cannot recognize input near '(' 'WITH' 'DATA_SET' in select clause 无法识别蜂巢附近的输入 - cannot recognize input near in hive 失败:ParseException行1:21无法识别&#39;附近的输入 <EOF> &#39;&#39; <EOF> &#39;&#39; <EOF> 表名中的“ - FAILED: ParseException line 1:21 cannot recognize input near '<EOF>' '<EOF>' '<EOF>' in table name Hive 查询无法识别表达式规范中 &#39;select&#39; &#39;max&#39; &#39;(&#39; 附近的输入 - Hive Query cannot recognize input near 'select' 'max' '(' in expression specification 无法识别表达式规范 -Hive 中的 &#39;SELECT&#39; &#39;DISTINCT&#39; &#39;(&#39; 附近的输入 - cannot recognize input near 'SELECT' 'DISTINCT' '(' in expression specification -Hive ParseException行5:19无法识别表达式规范中的&#39;SELECT&#39;&#39;MIN&#39;&#39;(&#39;附近的输入(状态= 42000,代码= 40000) - ParseException line 5:19 cannot recognize input near 'SELECT' 'MIN' '(' in expression specification (state=42000,code=40000) 失败:ParseException行4:0无法识别表达式规范中“当”“ column_name”“ &lt;”附近的输入 - FAILED: ParseException line 4:0 cannot recognize input near 'when' 'column_name' '<' in expression specification 编译语句时出错:失败:ParseException行1:49无法识别语句中&#39;(&#39;&#39;stock_status_id&#39;&#39;,&#39;附近的输入 - Error while compiling statement: FAILED: ParseException line 1:49 cannot recognize input near '(' 'stock_status_id' ',' in statement 蜂巢| 无法创建分区表 ParseException - Hive | Unable to create a partitioned table | ParseException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM