hive sql中SELECT的表是json的 如:
CREATE EXTERNAL TABLE `db`.`table1`(
`boxsize` bigint COMMENT 'from deserializer',
****)
PARTITIONED BY (
`day` string)
ROW FORMAT SERDE
'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES (
'ignore.malformed.json'='true',
'is.datastream.json'='false')
STORED AS INPUTFORMAT
'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT
'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION
'hdfs://****'
在执行查询时遇到如下报错
Caused by: org.apache.hadoop.hive.serde2.SerDeException: Row is not a valid JSON Object - JSONException: Unterminated string at 1401 [character 1402 line 1]
解决办法:
alter table db.table1 set serdeproperties ("ignore.malformed.json" = "true");
没有评论