• hive索引表


    create table index_tmp(id int,name string,dt string) row format delimited fields terminated by ',' stored as textfile;


    load data local inpath '/usr/local/hivelog/index.txt' into table index_tmp;

     partition模式为不严谨

    set hive.exec.dynamic.partition.mode=nonstrict;

    打开动态partition

    set hive.exec.dynamic.partition=true;

    insert overwrite table index_test partition(dt) select id,name,dt from index_tmp;

        创建索引表

    create index index_dom01 on table index_test(id) as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild;

    alter index index_dom01  on index_test rebuild;
                    查看索引
    show index on index_test; 
                    删除索引
     drop index index_dom01 on index_test;  

  • 相关阅读:
    C# macro function via #define __FILE__ __LINE__ ___FUNCTION__ __DATE__ __TIME__
    3
    2月23号
    3月26
    impala故障
    2月3号日更
    HDFS某个节点的磁盘满了
    3月2
    mq集群
    3月3
  • 原文地址:https://www.cnblogs.com/yaohaitao/p/5857205.html
Copyright © 2020-2023  润新知