如何在Hive中使用索引?

时间:2012-07-26 16:32:00

标签: hadoop indexing hive

我写了自定义索引处理程序并想测试它。但蜂巢不使用它。所以我检查了简单的表(pokes (int foo, string bar)),它带有h​​ive发行版用于测试目的。然后我创建了一个紧凑的索引并设置set hive.optimize.index.filter=true;但是,在检查日志信息时,似乎hive仍然没有使用索引。那么,问题是什么? 我发出的查询是select foo from pokes WHERE foo=498

下面是我发出查询后得到的日志信息。

12/07/26 12:25:17 INFO index.IndexWhereProcessor: Processing predicate for index optimization
12/07/26 12:25:17 INFO index.IndexWhereProcessor: (foo = 498) 

12/07/26 12:25:17 INFO metastore.HiveMetaStore: 0: get_table : db=default tbl=pokes_idx

12/07/26 12:25:17 INFO hive.log: DDL: struct pokes_idx { i32 foo, string _bucketname, list<i64> _offsets}
12/07/26 12:25:17 INFO index.IndexWhereProcessor: checking index staleness...  
12/07/26 12:25:17 INFO index.IndexWhereProcessor: 1342465077455

12/07/26 12:25:17 INFO index.IndexWhereProcessor: 1342465077455

12/07/26 12:25:17 INFO util.NativeCodeLoader: Loaded the native-hadoop library

12/07/26 12:25:17 WARN snappy.LoadSnappy: Snappy native library not loaded

0 个答案:

没有答案