row_number 随机数 数据倾斜
时间: 2023-08-26 19:18:22 浏览: 154
对于数据倾斜问题,可以使用随机数来解决。具体做法是将数据的key值与一个0到分区数之间的随机数相加,得到新的key值,然后再进行处理。这样可以将原本导致数据倾斜的大值key分散到多个分区中,从而实现数据的均衡分布。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [Hive ROW_NUMBER TopN 性能优化](https://blog.csdn.net/SunnyYoona/article/details/129094825)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
- *2* [spark sql 使用row_number 出现oom](https://blog.csdn.net/alitech2017/article/details/130619671)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文