假设我想使用"Order By" 子句执行Select 查询,并且我的数据分布在多台机器 上。 Map 如何减少获取数据 以及它在哪里执行“Order By” 查询。
最佳答案
Map-Reduce 可用于实现分布式“Order By”。
... One of Yahoo’s Hadoop clusters sorted 1 terabyte of data in 209 seconds ... The sort used 1800 maps and 1800 reduces ...
这可以通过按值将顺序键映射到范围来完成。
然而,Hive 正在使用单个 reducer 实现“Order By”。
... in order to impose total order of all results, there has to be one reducer to sort the final output. If the number of rows in the output is too large, the single reducer could take a very long time to finish...
关于Hadoop Mapreduce 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42924592/