1. 动态分区导入
    set hive.exec.dynamici.partition=true;
    set hive.exec.dynamic.partition.mode=nonstrict;

  2. 随机范围日期
    select cast(rand()*(1561910400-1514736000)+1514736000 as int) tstime;
    select from_unixtime(tstime,’yyyy-MM-dd’),from_unixtime(tstime,’yyyy-MM-dd HH:mm:ss’);

  3. 解析复杂json

    with ta as (
    select '[{"a":1},{"a":2}]' as a
    )
    -- 拆分json数组
    , taa as (
    select aa from ta lateral view explode(split(regexp_replace(regexp_replace(a , '\\]|\\[' ,'') ,'\\}\\,\\{','\\}\\;\\{' ),'\\;') ) b as aa
    )
    -- 使用json_tuple解析
    select json_tuple(aa,'a')
    from taa
  4. todo