Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/8854#discussion_r40117487
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/SortMergeJoin.scala
---
@@ -82,6 +79,28 @@ case class SortMergeJoin(
left.execute().zipPartitions(right.execute()) { (leftIter, rightIter)
=>
new RowIterator {
+ // The projection used to extract keys from input rows of the left
child.
+ private[this] val leftKeyGenerator = {
+ if (isUnsafeMode) {
+ // It is very important to use UnsafeProjection if input rows
are UnsafeRows.
+ // Otherwise, GenerateProjection will cause wrong results.
+ UnsafeProjection.create(leftKeys, left.output)
+ } else {
+ newProjection(leftKeys, left.output)
+ }
+ }
+
+ // The projection used to extract keys from input rows of the
right child.
+ private[this] val rightKeyGenerator = {
+ if (isUnsafeMode) {
--- End diff --
Had another discussion. We will do the cleanup work in a follow up pr.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]