gpt4 book ai didi

hadoop - hive |无法创建分区表 |解析异常

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

我正在尝试从 Hive CLI 创建一个分区表,

CREATE EXTERNAL TABLE IF NOT EXISTS stocks (
ymd STRING,
price_open FLOAT,
price_high FLOAT,
price_low FLOAT,
price_close FLOAT,
volume FLOAT,
price_adj_close FLOAT
)
PARTITIONED BY (exchange STRING, symbol STRING)
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',';

但是终端抛出异常而不是“ParseException”。

错误转储,

NoViableAltException(100@[])
at org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.identifier(HiveParser_IdentifiersParser.java:11545)
at org.apache.hadoop.hive.ql.parse.HiveParser.identifier(HiveParser.java:44551)
at org.apache.hadoop.hive.ql.parse.HiveParser.columnNameType(HiveParser.java:38215)
at org.apache.hadoop.hive.ql.parse.HiveParser.columnNameTypeList(HiveParser.java:36417)
at org.apache.hadoop.hive.ql.parse.HiveParser.tablePartition(HiveParser.java:32852)
at org.apache.hadoop.hive.ql.parse.HiveParser.createTableStatement(HiveParser.java:4922)
at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2364)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1586)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1062)
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 10:17 cannot recognize input near 'exchange' 'STRING' ',' in column specification

知道我在这里遗漏了什么吗?语法看起来无可挑剔:)

谢谢

最佳答案

Exchange 是 hive 中的关键字。您必须为分区列使用不同的名称。

关于hadoop - hive |无法创建分区表 |解析异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35083713/

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