具有多个服务器的配置单元表

agxfikkp  于 2021-06-26  发布在  Hive
关注(0)|答案(1)|浏览(377)

我们有一个配置单元表 date . 它目前有序列文件格式,我想把它转换成Parquet表。
有没有可能,我们有新的分区与Parquet镶嵌,和旧的序列格式,所以我不需要回填它?

2cmtqfgy

2cmtqfgy1#

创建一个带有默认serde(lazysimpleserde)和默认stored(textfile)的外部空表。
添加分区。
alter partition set fileformat(或set serde)。

Hive语言手册

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';

相关问题