以下查询返回:
line 1:8: mismatched input 'EXTERNAL'. Expecting: 'OR', 'SCHEMA', 'TABLE', 'VIEW'
CREATE EXTERNAL TABLE IF NOT EXISTS adult_data_clean(
age bigint,
workclass string,
education string,
relationship string,
occupation string,
country string,
income_cat string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
STORED AS OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
's3://census-income-example/clean.data'
TBLPROPERTIES (
'classification'='csv'
'skip.header.line.count'='1')
发布于 2022-03-29 04:45:13
有两个错误:
parameters
OUTPUTFORMAT
之间缺少一个逗号,它之前不应该有STORED AS
(因为它只是从INPUTFORMAT
):继续。)
CREATE EXTERNAL TABLE IF NOT EXISTS adult_data_clean(
age bigint,
workclass string,
education string,
relationship string,
occupation string,
country string,
income_cat string
)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
's3://census-income-example/clean.data'
TBLPROPERTIES (
'classification'='csv',
'skip.header.line.count'='1')
是的,这些错误信息令人困惑和误导。
https://stackoverflow.com/questions/71655191
复制相似问题