Hive:Failed:ParseException 1:0行无法识别&#39; ls&#39;附近的输入。 &#39; <EOF>&#39; &#39; <EOF>&#39;

时间:2017-01-21 09:12:24

标签: hadoop hive

当我登录Hive并尝试使用Cloudera Quickstart CDH 5.5在我的localhost目录中执行文件列表时,获取ParseExeption失败/错误。 Haven尚未开始任何事情(创建数据库,表格和导入数据)。

[cloudera@quickstart module2]$ hive

Logging initialized using configuration in jar:file:/usr/jars/hive-common-1.1.0-cdh5.5.0.jar!/hive-log4j.properties
WARNING: Hive CLI is deprecated and migration to Beeline is recommended.
hive> **ls;**

**NoViableAltException(26@[])**

at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1025)

at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)

at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)

at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:393)

at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:305)

at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1110)

at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1158)

at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1047)

at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1037)

at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)

at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)

at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)

at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:756)

at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)

at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:606)

at org.apache.hadoop.util.RunJar.run(RunJar.java:221)

at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

FAILED: ParseException line 1:0 cannot recognize input near 'ls' EOF EOF

hive> 

***The EOF have less than and greater than brackets around them.***

1 个答案:

答案 0 :(得分:1)

你需要使用!用于shell命令或dfs -用于来自hive CIL的hdfs命令

  

! <command>从Hive shell执行shell命令。

     

dfs <command>从Hive shell执行dfs命令。

  hive> !ls;
  hive> dfs -ls;