天天看点

Hive Tuning(三) 从查询计划看hive.auto.convert.join的好处

今天我们来讲一下如何看懂hive的查询计划。

<b>hive的执行计划</b>包括三部分:

– abstract syntax tree – 可以直接忽略  

– stage dependencies – 依赖 

– stage plans – hive如何执行任务的信息。

Hive Tuning(三) 从查询计划看hive.auto.convert.join的好处

下面还是以一个案例作为说明

Hive Tuning(三) 从查询计划看hive.auto.convert.join的好处

设置自动连接为false的话,要走5步。

Hive Tuning(三) 从查询计划看hive.auto.convert.join的好处

4 map reduces tells you something is not right.  

    stage:    stage-1    

                map    reduce    

    stage:    stage-2    

    stage:    stage-3    

    stage:    stage-4    

                map    reduce   

设置自动连接为true就只有4步

Hive Tuning(三) 从查询计划看hive.auto.convert.join的好处

only 2 map reduces  

    stage:    stage-8    

                map    reduce

Hive Tuning(三) 从查询计划看hive.auto.convert.join的好处

hive直接就加载了要做连接的表,client和path表,其中client表做了过滤,剩下的map/reduce是用来连接和排序的。