gpt4 book ai didi

hadoop - 配置单元失败 : ParseException line 2:0 cannot recognize input near '' macaddress '' ' CHAR' '(' in column specification

转载 作者:可可西里 更新时间:2023-11-01 14:18:04 27 4
gpt4 key购买 nike

我试过运行 hive -v -f sqlfile.sql

文件内容如下

CREATE TABLE UpStreamParam (
'macaddress' CHAR(50),
'datats' BIGINT,
'cmtstimestamp' BIGINT,
'modulation' INT,
'chnlidx' INT,
'severity' BIGINT,
'rxpower' FLOAT,
'sigqnoise' FLOAT,
'noisedeviation' FLOAT,
'prefecber' FLOAT,
'postfecber' FLOAT,
'txpower' FLOAT,
'txpowerdrop' FLOAT,
'nmter' FLOAT,
'premtter' FLOAT,
'postmtter' FLOAT,
'unerroreds' BIGINT,
'corrected' BIGINT,
'uncorrectables' BIGINT)
STORED AS ORC TBLPROPERTIES ("orc.compress"="SNAPPY","orc.bloom.filters.columns"="macaddress")
PARTITIONED BY ('cmtsid' CHAR(50),' date' INT)
LOCATION '/usr/hive/warehouse/UpStreamParam' ;

我收到以下错误:

FAILED: ParseException line 2:0 cannot recognize input near ''macaddress'' 'CHAR' '(' in column specification

最佳答案

首先,列名必须被`(反引号)包围,而不是'(单引号)。

因此,您必须将 'macaddress' 替换为 `macaddress`,以及所有其他列名。

其次,STORED ASTBLPROPERTIES以及PARTITIONED BYLOCATION的顺序是错误的。正确的顺序是PARTITIONED BYSTORED ASLOCATIONTBLPROPERTIES

有关详细信息,请参阅 hive 语言手册。 https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-CreateTable

所以正确的代码是

CREATE TABLE UpStreamParam (
`macaddress` CHAR(50),
`datats` BIGINT,
`cmtstimestamp` BIGINT,
`modulation` INT,
`chnlidx` INT,
`severity` BIGINT,
`rxpower` FLOAT,
`sigqnoise` FLOAT,
`noisedeviation` FLOAT,
`prefecber` FLOAT,
`postfecber` FLOAT,
`txpower` FLOAT,
`txpowerdrop` FLOAT,
`nmter` FLOAT,
`premtter` FLOAT,
`postmtter` FLOAT,
`unerroreds` BIGINT,
`corrected` BIGINT,
`uncorrectables` BIGINT)
PARTITIONED BY (`cmtsid` CHAR(50), `date` INT)
STORED AS ORC
LOCATION '/usr/hive/warehouse/UpStreamParam'
TBLPROPERTIES ("orc.compress"="SNAPPY","orc.bloom.filters.columns"="macaddress");

关于hadoop - 配置单元失败 : ParseException line 2:0 cannot recognize input near '' macaddress '' ' CHAR' '(' in column specification,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32191404/

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