Hive错误:parseexception缺少EOF [英] Hive error: parseexception missing EOF

查看:9694
本文介绍了Hive错误:parseexception缺少EOF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我在这里做错了什么:

  hive> CREATE TABLE default.testtbl(int1 INT,string1 STRING)
存储为orc
tblproperties(orc.compress=NONE)
LOCATION/ user / hive / test_table;

失败:ParseException第1行:107在'LOCATION'''''''''''处丢失EOF'

,而以下查询工作得很好:

  hive> CREATE TABLE default.testtbl(int1 INT,string1 STRING)
存储为orc
tblproperties(orc.compress=NONE);
OK
花费的时间:0.106秒

任何指针都会有帮助。谢谢!

解决方案

尝试在下面的tblproperties前放置LOCATION,为我工作。

  CREATE TABLE default.testtbl(int1 INT,string1 STRING)
存储为orc
LOCATION/ user / hive / test_table
tblproperties(orc.compress=NONE);

看起来即使是Programming Hive一书中的示例SQL也得到了错误的命令。请参考create table命令的官方定义:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTable


I am not sure what I am doing wrong here:

hive> CREATE TABLE default.testtbl(int1 INT,string1 STRING)  
      stored as orc 
      tblproperties ("orc.compress"="NONE") 
      LOCATION "/user/hive/test_table";

      FAILED: ParseException line 1:107 missing EOF at 'LOCATION' near ')'

while the following query works perfectly fine:

hive>  CREATE TABLE default.testtbl(int1 INT,string1 STRING)  
       stored as orc 
       tblproperties ("orc.compress"="NONE");
       OK
       Time taken: 0.106 seconds

Am I missing something here. Any pointers will help. Thanks!

解决方案

Try put the "LOCATION" in front of "tblproperties" like below, worked for me.

CREATE TABLE default.testtbl(int1 INT,string1 STRING)  
  stored as orc 
  LOCATION "/user/hive/test_table"
  tblproperties ("orc.compress"="NONE");

It seems even the sample SQL from book "Programming Hive" got the order wrong. Please reference to the official definition of create table command:

https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTable

这篇关于Hive错误:parseexception缺少EOF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆