Advertisement

Hive index operations summary

阅读量:

Hive 索引

目标:提升查询与检索的效率
构建索引:

复制代码
 create index t1_index on table person0(name)

    
 as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler'
    
 with deferred rebuild in table t1_index_table;
    
    
    
    

as:用于定义索引器;
in table:用于定义索引表,如未明确指定,则默认创建于 default_person0_t1_index_表中

复制代码
 create index t1_index on table person0(name)

    
 as 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' with deferred rebuild;
    
    
    
    

检索索引

复制代码
    show index on person0;
    

在完成索引建立之后,若需使相关操作产生实际效果,必须执行索引的重建过程。

复制代码

全部评论 (0)

还没有任何评论哟~