gpt4 book ai didi

sql - Hive:NoViableAltException(283@[]) 和解析异常

转载 作者:可可西里 更新时间:2023-11-01 15:04:03 26 4
gpt4 key购买 nike

我在配置单元中创建了下表。

CREATE TABLE IF NOT EXISTS employee (
eid int,
name String,
salary String,
destination String
)
COMMENT ‘Employee details’
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ‘\t’
LINES TERMINATED BY ‘\n’
STORED AS TEXTFILE;

表创建成功。我正在尝试执行以下插入操作

insert into TABLE employee (eid,name,salary,destination) VALUES (1,'avi','100000','boston');

但是,我收到以下错误消息。

NoViableAltException(283@[])
at org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:39678)
at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:38904)
at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:38780)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1514)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1052)
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:389)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:303)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1067)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1129)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1004)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:994)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:201)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:153)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:364)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:712)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:631)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:570)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
FAILED: ParseException line 1:27 cannot recognize input near '(' 'eid' ',' in statement

我该如何解决这个问题?

最佳答案

INSERT INTO employee select 1, 'avi', '100000', 'boston';

您的版本似乎不支持 insert 列列表,也不支持 values

附言
报错信息很清楚。
您应该关注最后一行。

关于sql - Hive:NoViableAltException(283@[]) 和解析异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43740382/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com