将set hive.limit.optimize.enable=true 时,limit限制数据时就不会全盘扫,而是根据限制的数量进行抽样。
同时还有两个配置项需要注意:
1、hive.limit.row.max.size 我理解这个是控制最大的抽样数量
2、 hive.limit.optimize.limit.file 我理解这个是抽样的最大文件数量