企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
Fetch抓取是指:Hive在某些情况下的查询可以不用走MapReduce程序,如全表查询、字段查询、limit查询。 ```sql hive (default)> select * from emp; hive (default)> select ename from emp; hive (default)> select ename from emp limit 5; ``` 像上面的三种查询,Hive可以简单地读取到employee对应的hdfs存储目录下的文件,将结果输出。 <br/> **开启Fetch抓取:** *`{hive_home}/conf/hive-site.xml`* ```xml <property> <name>hive.fetch.task.conversion</name> <!-- 默认就是more,开启--> <value>more</value> <description> Expects one of [none, minimal, more]. Some select queries can be converted to single FETCH task minimizing latency. Currently the query should be single sourced not having any subquery and should not have any aggregations or distincts (which incurs RS), lateral views and joins. 0. none : disable hive.fetch.task.conversion 1. minimal : SELECT STAR, FILTER on partition columns, LIMIT only // more: 该属性修改为 more 以后,在全局查找、字段查找、limit 查找等都不走 mapreduce 2. more : SELECT, FILTER, LIMIT only (support TABLESAMPLE andvirtual columns) </description> </property> ```