什么情况下Hive可以避免进行MapReduce
 hive 为了执行效率考虑,简单的查询,就是只是select,不带count,sum,group by这样的,都不走map/reduce,直接读取hdfs目录中的文件进行filter过滤。
sql select * from employee;
sql select * from order_partition where month=‘2020-05’;
此外,如果设置属性 set hive.exec.mode.local.auto=true; hive还是会尝试使用本地模式。
1、直接查询表的数据 不会进行Mapreduce。
 2、查询语句中的过滤条件只是分区字段的情况下 不会进行Mapreduce。
Hive表中间数据压缩
shell #设置为true为激活中间数据压缩功能,默认是false,没有开启 set hive.exec.compress.intermediate=true; #设置中间数据的压缩算法 set mapred.map.output.compression.codec= org.apache.hadoop.io.compress.SnappyCodec;