rcongiu / Hive-JSON-Serde

Read - Write JSON SerDe for Apache Hive.
Other
733 stars 391 forks source link

Partitioned By result in empty table #237

Open bofie opened 1 year ago

bofie commented 1 year ago

hi @rcongiu

I did

CREATE EXTERNAL TABLE `XXX`(
`ABC` string COMMENT 'from deserializer')
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES ( 'ignore.malformed.json' = 'true')
STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat'
LOCATION 'a hdfs folder';

which can generate the table with data populated

but when I added partitioned by

CREATE EXTERNAL TABLE `XXX`(
`ABC` string COMMENT 'from deserializer')
PARTITIONED BY (`partition_year` string, `partition_month` string, `partition_day` string)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
WITH SERDEPROPERTIES ( 'ignore.malformed.json' = 'true')
STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat'
LOCATION 'a hdfs folder';

It always returned "OK" but the table is empty. Do you know why that might happen? Thanks