[ https://issues.apache.org/jira/browse/HIVE-8017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14126674#comment-14126674 ]
Rui Li commented on HIVE-8017: ------------------------------ [~xuefuz], spark doesn't guarantee order for group-by queries. And the hash code of BytesWrtiable and HiveKey are computed differently. So the records produced by the mappers are likely to be partitioned to different reducers. I believe that's why we got different results (only different in order) after the change. I don't quite get the point of your last comment. I did try adding {{-- SORT_BEFORE_DIFF}} in the q file. It just seems the test framework is a little particular about where we should put it (the test failed to run if I put it before the {{set}} commands in the q file). [~brocknoland] do you have any comments as how to use the {{-- SORT_BEFORE_DIFF}} label? > Use HiveKey instead of BytesWritable as key type of the pair RDD [Spark > Branch] > ------------------------------------------------------------------------------- > > Key: HIVE-8017 > URL: https://issues.apache.org/jira/browse/HIVE-8017 > Project: Hive > Issue Type: Sub-task > Components: Spark > Reporter: Rui Li > Assignee: Rui Li > Attachments: HIVE-8017-spark.patch > > > HiveKey should be used as the key type because it holds the hash code for > partitioning. While BytesWritable serves partitioning well for simple cases, > we have to use {{HiveKey.hashCode}} for more complicated ones, e.g. join, > bucketed table, etc. -- This message was sent by Atlassian JIRA (v6.3.4#6332)