hive 中的Sort By、 Order By、Cluster By、Distribute By 区别<转>
2014-10-31 11:54
393 查看
Order by:
order by 会对输入做全局排序,因此只有一个reducer(多个reducer无法保证全局有序)
只有一个reducer,会导致当输入规模较大时,需要较长的计算时间。
在hive.mapred.mode=strict模式下,强制必须添加limit限制,这么做的目的是减少reducer数据规模
Sort by:
sort by不是全局排序,其在数据进入reducer前完成排序。
因此,如果用sort by进行排序,并且设置 mapred.reduce.tasks>1, 则sort by只保证每个reducer的输出有序,不保证全局有序。Distribute by:
根据distribute by指定的内容将数据分到同一个reducer
Cluster by:
除了具有Distribute by的功能外,还会对该字段进行排序。因此,常常认为cluster by = distribute by + sort by
order by 会对输入做全局排序,因此只有一个reducer(多个reducer无法保证全局有序)
只有一个reducer,会导致当输入规模较大时,需要较长的计算时间。
在hive.mapred.mode=strict模式下,强制必须添加limit限制,这么做的目的是减少reducer数据规模
Sort by:
sort by不是全局排序,其在数据进入reducer前完成排序。
因此,如果用sort by进行排序,并且设置 mapred.reduce.tasks>1, 则sort by只保证每个reducer的输出有序,不保证全局有序。Distribute by:
根据distribute by指定的内容将数据分到同一个reducer
Cluster by:
除了具有Distribute by的功能外,还会对该字段进行排序。因此,常常认为cluster by = distribute by + sort by
相关文章推荐
- hive 中 Order by, Sort by ,Dristribute by,Cluster By 的作用和用法<转>
- hive中order by,sort by,distribute by,Cluster By的区别
- hive 中的Sort By、 Order By、Cluster By、Distribute By 区别
- Hive中order by,sort by,distribute by,cluster by的区别
- hive排序:distribute by 、sort by 、cluster by 、order by 区别
- Hive中order by,sort by,distribute by,cluster by的区别
- Hive中order by,sort by,distribute by,cluster by的区别
- hive的order by、sort by、cluster by、distribute by的区别与用法
- HIVE 中 order by, sort by, distribute by, cluster by的用法和区别
- hive中order by、distribute by、sort by和cluster by的区别和联系
- Hive中order by,sort by,distribute by,cluster by的区别
- Hive中order by,sort by,distribute by,cluster by的区别
- Hive中order by、sort by、distribute by、cluster by的区别
- Hive中order by,sort by,distribute by,cluster by的区别
- hive 之 order by,sort by, distribute by, cluster by 区别
- hive sort by,order by ,distribute by,cluster by
- hive中order by,sort by, distribute by, cluster by作用以及用法
- hive中order by,sort by, distribute by, cluster by作用以及用法
- hive中order by,sort by, distribute by, cluster by作用以及用法
- Hive-2.HiveQL查询中ORDER BY 和SORT BY 语句|包含SORT BY 的DISTRIBUTE BY|CLUSTER BY