我正在尝试将记录插入到我创建的表中。但它失败了failedpredicateexception(
我尝试在select语句中使用alias,然后在sql中使用列名,但是失败了,出现了相同的错误。有什么问题吗?
create table sales_log(
trxn_uuid string,
unit_sold int,
unihprice decimal(13,4),
event_ts timestamp
)
stored as orc
location '/user/me/sales/sales_log';
insert into sales_log select 'axxx1', 2, 8,cast('2018-01-01 06:34:56.789' as timestamp);
hive> insert into sales_log select 'axxx1', 2, 8,cast('2018-01-01 06:34:56.789' as timestamp);
FailedPredicateException(regularBody,{$s.tree.getChild(1) !=null}?)
at org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:43166)
at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:42341)
at org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:42211)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1681)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1152)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:211)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:171)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:438)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:321)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1224)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1265)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1161)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1151)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:217)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:169)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:380)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:740)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:685)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:625)
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:233)
at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
FAILED: ParseException line 1:87 Failed to recognize predicate '<EOF>'. Failed rule: 'regularBody' in statement
1条答案
按热度按时间kknvjkwl1#
已知问题,已在配置单元1.3.1/2.0中修复。
你不能使用
insert as select
没有from
早期版本中的子句。使用insert重写查询into ... values ...
或者升级到最新的配置单元版本。