美文网首页
Hive表支持多种格式

Hive表支持多种格式

作者: 初级程序员_10086 | 来源:发表于2018-11-22 09:46 被阅读0次
    1. 不同的分区有不同的数据存储格式(例如:parquet、json、avro、orc等)
    2. 可以通过修改分区的格式实现。
    3. 表需要创建为默认的格式(LazySimpleSerDe)

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

    相关文章

      网友评论

          本文标题:Hive表支持多种格式

          本文链接:https://www.haomeiwen.com/subject/ldvkqqtx.html