代码之家  ›  专栏  ›  技术社区  ›  smellerbee

为什么在配置单元中插入记录时失败,出现FailedPredicateException?

  •  0
  • smellerbee  · 技术社区  · 7 年前

    我正在尝试将记录插入到我创建的表中。但失败的是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 回复  |  直到 7 年前
        1
  •  1
  •   vvg    7 年前

    已知问题,已在Hive 1.3.1/2.0中修复。

    insert as select 没有 from into ... values ... 或者升级到最新的配置单元版本。