内容简介:Hive 中Hive 中的Hive 中的
ORDER BY
Hive 中 ORDER BY
的行为与关系型数据库的 ORDER BY
行为一致,实现了数据集的 全局排序
,支持升序(ASC)和降序(DESC)。
SORT BY
Hive 中的 SORT BY
实现了数据集的 Map 排序
,为每个 reducer 产生一个 排序 文件,支持升序(ASC)和降序(DESC)。如果只有一个 reducer(通过 SET mapred.reduce.tasks=1
),那么 SORT BY
和 ORDER BY
的效果是相同的。
DISTRIBUTE BY
Hive 中的 DISTRIBUTE BY
实现了数据集的 Map 重分区
,保证字段值相同的行在同一个 reducer。
CLUSTER BY
Hive 中的 CLUSTER BY
结合了 SORT BY
和 DISTRIBUTE BY
,实现了数据集的 局部排序
,支持升序(ASC)和降序(DESC)。
参考
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Twenty Lectures on Algorithmic Game Theory
Tim Roughgarden / Cambridge University Press / 2016-8-31 / USD 34.99
Computer science and economics have engaged in a lively interaction over the past fifteen years, resulting in the new field of algorithmic game theory. Many problems that are central to modern compute......一起来看看 《Twenty Lectures on Algorithmic Game Theory》 这本书的介绍吧!