zoukankan      html  css  js  c++  java
  • hive-动态分区

    迁移脚本初始化时需要将以前的历史数据分区也迁移过来,就可以用到动态分区了
    set hive.exec.dynamic.partition.mode=nonstrict;
    set hive.exec.dynamic.partition=true;
    set hive.exec.max.dynamic.partitions.pernode=100000;
    set hive.exec.max.dynamic.partitions=100000;
     
    insert overwrite table sda.sda02_lplog_flat partition (etl_tx_dt)
    select
    *
    from dev_iqj_dw_dev.sda02_lp_log
    where etl_tx_dt <= 20190315
    ;

     参数说明:

    set hive.exec.dynamic.partition=true; 
    是否开启动态分区功能,默认false关闭,使用动态分区时候,该参数必须设置成true;

    set hive.exec.dynamic.partition.mode=nonstrict;
    动态分区的模式,默认strict,表示必须指定至少一个分区为静态分区,nonstrict模式表示允许所有的分区字段都可以使用动态分区。

    set hive.exec.max.dynamic.partitions.pernode=100000;
    默认值:100
    在每个执行MR的节点上,最大可以创建多少个动态分区。
    该参数需要根据实际的数据来设定。
    比如:源数据中包含了一年的数据,即day字段有365个值,那么该参数就需要设置成大于365,如果使用默认值100,则会报错。

    set hive.exec.max.dynamic.partitions=100000;
    默认值:1000
    在所有执行MR的节点上,最大一共可以创建多少个动态分区。
    同上参数解释。

    hive.exec.max.created.files
    默认值:100000
    整个MR Job中,最大可以创建多少个HDFS文件。
    一般默认值足够了,除非你的数据量非常大,需要创建的文件数大于100000,可根据实际情况加以调整。

    hive.error.on.empty.partition
    默认值:false
    当有空分区生成时,是否抛出异常。
    一般不需要设置。

  • 相关阅读:
    Unreal Engine 4 Based Materials
    PhysX Clothing for UE4
    UE4中使用URL图片
    开始创作自己的VR作品——VR故事叙述终极指南
    UE4里的自定义深度功能
    Mybatis27题
    java 备用待迁移
    几个算法题目
    数据结构算法题目
    Mybatis 面试题
  • 原文地址:https://www.cnblogs.com/dcx-1993/p/10615353.html
Copyright © 2011-2022 走看看