读书人

Hive-0.8.1目录的实验

发布时间: 2012-09-03 09:48:39 作者: rapoo

Hive-0.8.1索引的实验

先说一个0.7.1和0.8.1的Metastore不兼容

一。外部表的索引。

因为怕麻烦,就继续用之前的table02的数据,在new meta里也叫table02,不过改成了external表。最后的结论是Hive的索引也是支持外部表的。

建立索引,运行。还是6个mapper,不行。

二。建立内部表

CTAS from table02,建立一个内部表table03;

?

重点是,换了0.8.1,

<property>
? <name>hive.optimize.index.filter</name>
? <value>true</value>
? <description>Whether to enable automatic use of indexes</description>
</property>

建立了索引:

?

hive> select * from table02 where id=500000;Total MapReduce jobs = 3Launching Job 1 out of 3Number of reduce tasks is set to 0 since there's no reduce operatorStarting Job = job_201203122135_0010, Tracking URL = http://localhost:50030/jobdetails.jsp?jobid=job_201203122135_0010Kill Command = /home/allen/Hadoop/hadoop-0.20.2/bin/../bin/hadoop job -Dmapred.job.tracker=localhost:9001 -kill job_201203122135_0010Hadoop job information for Stage-3: number of mappers: 1; number of reducers: 02012-03-12 22:12:18,347 Stage-3 map = 0%, reduce = 0%2012-03-12 22:12:33,834 Stage-3 map = 100%, reduce = 0%2012-03-12 22:12:40,078 Stage-3 map = 100%, reduce = 100%Ended Job = job_201203122135_0010Ended Job = -1685536326, job is filtered out (removed at runtime).Moving data to: hdfs://localhost:9000/tmp/hive-allen/hive_2012-03-12_22-12-07_069_3484347533083360337/-ext-10000Moving data to: hdfs://localhost:9000/tmp/hive-allen/hive_2012-03-12_22-12-06_413_2863963861844056912/-mr-10002Launching Job 3 out of 3Number of reduce tasks is set to 0 since there's no reduce operatorStarting Job = job_201203122135_0011, Tracking URL = http://localhost:50030/jobdetails.jsp?jobid=job_201203122135_0011Kill Command = /home/allen/Hadoop/hadoop-0.20.2/bin/../bin/hadoop job -Dmapred.job.tracker=localhost:9001 -kill job_201203122135_0011Hadoop job information for Stage-1: number of mappers: 1; number of reducers: 02012-03-12 22:12:53,124 Stage-1 map = 0%, reduce = 0%2012-03-12 22:13:04,590 Stage-1 map = 100%, reduce = 0%2012-03-12 22:13:10,897 Stage-1 map = 100%, reduce = 100%Ended Job = job_201203122135_0011MapReduce Jobs Launched: Job 0: Map: 1 HDFS Read: 74706082 HDFS Write: 68 SUCESSJob 1: Map: 1 HDFS Read: 33554431 HDFS Write: 357 SUCESSTotal MapReduce CPU Time Spent: 0 msecOK500000A decade ago, many were predicting that Cooke, a New York City prodigy, would become a basketball shoe pitchman and would flaunt his wares and skills at All-Star weekends like the recent aerial show in Orlando, Fla. There was a time, however fleeting, when he was more heralded, or perhaps merely hyped, than any other high school player in America.Time taken: 65.212 secondshive> 问题就是那个启动index的阈值没有设置:hive.optimize.index.filter.compact.minsize

?

http://blog.csdn.net/liwei_1988/article/details/7346064

读书人网 >其他数据库

热点推荐