我们有一个由date
分区的HIVE表。它目前有Sequence文件格式,我想把它转换成Parquet Table。
我们是否有可能使用Parquet Serde进行新的分区,而使用序列格式更新,以便我不需要回填它?
答案 0 :(得分:0)
使用默认serde(LazySimpleSerDe)和默认存储(文本文件)创建一个外部空表。
添加分区。
更改分区设置文件格式(或设置serde)。
CREATE EXTERNAL TABLE test(ip string, localTime string )
PARTITIONED BY (partition__hive__ STRING) location '/tmp/table/empty';
alter table test add partition (partition__hive__='p_0') location 'hdfs://hdfsTest/hive/table/test/2018/11/21/08';
alter table test partition (partition__hive__='p_0') SET FILEFORMAT parquet;
alter table test add partition (partition__hive__='p_1') location 'hdfs://hdfsTest/hive/table/test/2018/11/21/09';
alter table test partition (partition__hive__='p_1') SET SERDE 'org.apache.hive.hcatalog.data.JsonSerDe';