创建配置单元外部表时出错

hkmswyz6  于 2021-05-31  发布在  Hadoop
关注(0)|答案(1)|浏览(524)

创建外部配置单元表时,在错误配置单元(yatish)下获取

CREATE EXTERNAL TABLE yatish_h1b_data_ak 
(    
     ID:INT,
     CASE_STATUS:VARCHAR,
     EMPLOYER_NAME:VARCHAR,
     SOC_NAME:VARCHAR,
     JOB_TITLE:VARCHAR,
     FULL_TIME_POSITION:VARCHAR,
     PREVAILING_WAGE:FLOAT,
     YEAR:INT,
     WORKSITE:VARCHAR,
     LONGITUDE:VARCHAR,
     LATITUDE:VARCHAR 
)
ROW FORMAT DELIMITED              
FIELDS TERMINATED BY \073' LINE TERMINATED BY '\n'              
LOCATION user/seethayatish/yatish;

NoviableException(9@[])
在org.apache.hadoop.hive.ql.parse.hiveparser.type(hiveparser。java:40648)>位于org.apache.hadoop.hive.ql.parse.hiveparser.coltype(hiveparser。java:40405)在org.apache.hadoop.hive.ql.parse.hiveparser.columnnametype(hiveparser。java:40089)在org.apache.hadoop.hive.ql.parse.hiveparser.columnnametypelist(hiveparser。java:38213)在org.apache.hadoop.hive.ql.parse.hiveparser.createtablestatement(hiveparser。java:6726)在org.apache.hadoop.hive.ql.parse.hiveparser.ddlstatement(hiveparser.com)上。java:4122)在org.apache.hadoop.hive.ql.parse.hiveparser.execstatement(hiveparser。java:1786)在org.apache.hadoop.hive.ql.parse.hiveparser.statement(hiveparser。java:1152)在org.apache.hadoop.hive.ql.parse.parsedriver.parse(parsedriver。java:211)在org.apache.hadoop.hive.ql.parse.parsedriver.parse(parsedriver。java:171)在org.apache.hadoop.hive.ql.driver.compile(driver。java:447)在org.apache.hadoop.hive.ql.driver.compile(driver。java:330)位于org.apache.hadoop.hive.ql.driver.compileinternal(驱动程序。java:1233)在org.apache.hadoop.hive.ql.driver.runinternal(驱动程序。java:1274)在org.apache.hadoop.hive.ql.driver.run(driver。java:1170)在org.apache.hadoop.hive.ql.driver.run(driver。java:1160)在org.apache.hadoop.hive.cli.clidriver.processlocalcmd(clidriver。java:217)在org.apache.hadoop.hive.cli.clidriver.processcmd(clidriver。java:169)在org.apache.hadoop.hive.cli.clidriver.processline(clidriver。java:380)在org.apache.hadoop.hive.cli.clidriver.executedriver(clidriver。java:740)在org.apache.hadoop.hive.cli.clidriver.run(clidriver。java:685)位于org.apache.hadoop.hive.cli.clidriver.main(clidriver。java:625)位于sun.reflect.nativemethodaccessorimpl.invoke0(本机方法)sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl。java:62)在sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl。java:43)在java.lang.reflect.method.invoke(方法。java:498)在org.apache.hadoop.util.runjar.run(runjar。java:233)在org.apache.hadoop.util.runjar.main(runjar。java:148)失败:parseexception行1:45无法识别列类型中“:”int“,”附近的输入

ergxz8rk

ergxz8rk1#

您错误地编写了create table语句。字段名与其数据类型之间没有冒号(:)。只需在字段名和它的数据类型之间保留空格。此外,配置单元中不支持varchar和float类型,而是使用string和double。
以下是正确的陈述:

CREATE EXTERNAL TABLE yatish_h1b_data_ak ( 

ID                   INT,
CASE_STATUS          STRING,
EMPLOYER_NAME        STRING,
SOC_NAME             STRING,
JOB_TITLE            STRING,
FULL_TIME_POSITION   STRING,
PREVAILING_WAGE      FLOAT,
YEAR                 INT,
WORKSITE             STRING,
LONGITUDE            STRING,
LATITUDE             STRING ) 

ROW FORMAT DELIMITED  

FIELDS TERMINATED BY '\073' 

LINES TERMINATED BY '\n' 

LOCATION '/user/seethayatish/yatish';

相关问题