FAILED:ParseException第1:1行无法识别'where''datetime''='附近的输入

时间:2017-11-13 13:48:27

标签: java hadoop hive mapreduce

我在下面的hive中创建了新表是声明。

CREATE EXTERNAL TABLE sk_test (
  regId String,
  epochtime String
)
COMMENT 'SK_test'
PARTITIONED BY (dateTime  String)
 ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' 
LOCATION '/user/cloudera/OutputFile/';

位置是我的HDFS路径

以下是我的HDFS中存在的数据

1TPwr9N,    , 1509075042823, 2017-10-26 20:30:42
2DPqe1s,    , 1509074972821, 2017-10-26 20:29:32
2YXsF7r,    , 1509073795109, 2017-10-26 20:09:55
3oxTk7C,    , 1509075132826, 2017-10-26 20:32:12
41Nw9r0,    , 1509073885111, 2017-10-26 20:11:25
5yORSIU,    , 1509074952821, 2017-10-26 20:29:12
8LfyAWp,    , 1509074942820, 2017-10-26 20:29:02

当我选择查询时,我收到以下错误消息。请告诉我这是错误的。

hive> select * from sk_test where datetime='2017-10-26 20:28:42';
OK
Time taken: 0.823 seconds
NoViableAltException(283@[])
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1028)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:201)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:522)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1356)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1473)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1285)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1275)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:220)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:172)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:383)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:775)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:693)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:628)
    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:1 cannot recognize input near 'where' 'datetime' '='

0 个答案:

没有答案