Hive Does the order of the data record matters for joining tables

微笑、不失礼 提交于 2019-11-27 07:24:12

问题


I would like to know if the order of the data records matter (performance wise) when joining two tables?
P.S. I am not using any map-side join or bucket join.

Thank you!


回答1:


On the one hand order should not matter because during shuffle join files are being read by mappers in parallel, also files may be splitted between few mappers or vice-versa, one mapper can read few files, then mappers output passed to each reducer. And even if data was ordered it is being read and distributed not in it's order due to parallelism. On the other hand, ordering data may improve compression depending on the data entropy. Similar rows can be compressed better. Therefore files ordered compressed files can be smaller and they will be read faster during join query execution. This may improve join speed because mappers will read data faster. Also indexes in ORC may work more efficient for filtering if data was ordered during load. It depends on your data entropy and filters you are using.



来源:https://stackoverflow.com/questions/47404937/hive-does-the-order-of-the-data-record-matters-for-joining-tables

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!