HIVE Indexex 索引
Creating an Index -- 建立一個索引
- CREATE TABLE employees (
- name STRING,
- salary FLOAT,
-
subordinates ARRAY
, -
deductions MAP
FLOAT >, -
address STRUCT
INT > - )
- PARTITIONED BY (country STRING, state STRING);
Let’s index on the country partition only:
- CREATE INDEX employees_index
- ON TABLE employees (country)
- AS 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler'
- WITH DEFERRED REBUILD
- IDXPROPERTIES ('creator = 'me', 'created_at' = 'some_time')
- IN TABLE employees_index_table
- PARTITIONED BY (country, name)
- COMMENT 'Employees indexed by country and name.';
Bitmap Indexes
Hive v0.8.0 adds a built-in bitmap index handler. Bitmap indexes are commonly used
for columns with few distinct values. Here is our previous example rewritten to use the
bitmap index handler:
- CREATE INDEX employees_index
- ON TABLE employees (country)
- AS 'BITMAP'
- WITH DEFERRED REBUILD
- IDXPROPERTIES ('creator = 'me', 'created_at' = 'some_time')
- IN TABLE employees_index_table
- PARTITIONED BY (country, name)
- COMMENT 'Employees indexed by country and name.';
Rebuilding the Index
- ALTER INDEX employees_index
- ON TABLE employees
- PARTITION (country = 'US')
- REBUILD;
Showing an Index
- SHOW FORMATTED INDEX ON employees;
Dropping an Index
- DROP INDEX IF EXISTS employees_index ON TABLE employees;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26613085/viewspace-1131361/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- hadoop,hive啟用lzo壓縮和建立lzo索引薦HadoopHive索引
- HIVE隨手記——Hive命令(?$HIVE_HOME/bin/hive)Hive
- [Hive]Hive排序優化Hive排序優化
- Hive --------- hive 的優化Hive優化
- Hive之 hive架構Hive架構
- [hive] hive cli 命令列Hive命令列
- 【Hive】hive資料遷移Hive
- Hive篇--搭建Hive叢集Hive
- Hive篇---Hive使用優化Hive優化
- Hive學習之六 《Hive進階— —hive jdbc》 詳解HiveJDBC
- 【Hive一】Hive安裝及配置Hive
- [Hive]Hive實現抽樣查詢Hive
- Hive -------- hive常見查詢練習Hive
- HIVE基本語法以及HIVE分割槽Hive
- Hive學習之Hive的安裝Hive
- hive匯出到csv hive匯出到excelHiveExcel
- Hive的原理—— 深入淺出學HiveHive
- hive學習之一:認識hiveHive
- spark with hiveSparkHive
- hive partitionHive
- hive nullHiveNull
- [Hive]hive分割槽設定注意事項Hive
- [hive]hive資料模型中四種表Hive模型
- Hive SQL 監控系統 - Hive FalconHiveSQL
- Hive之 hive與hadoop的聯絡HiveHadoop
- flink實戰--讀寫Hive(Flink on Hive)Hive
- 【大資料開發】Hive——Hive函式大全大資料Hive函式
- Hive之Hive快捷查詢(避免Mapruduce查詢)Hive
- Hive shell 命令Hive
- Hive學習Hive
- Hive架構Hive架構
- Hive 常用操作Hive
- hive on spark配置HiveSpark
- Hive 入門Hive
- hive函式Hive函式
- Spark整合hiveSparkHive
- Hive安裝Hive
- Hive入門Hive