Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/7480#discussion_r35257413
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashOuterJoin.scala
---
@@ -59,6 +59,49 @@ override def outputPartitioning: Partitioning = joinType
match {
}
}
+ protected[this] lazy val (buildPlan, streamedPlan) = joinType match {
+ case RightOuter => (left, right)
+ case LeftOuter => (right, left)
+ case x =>
+ throw new IllegalArgumentException(
+ s"HashOuterJoin should not take $x as the JoinType")
+ }
+
+ protected[this] lazy val (buildKeys, streamedKeys) = joinType match {
+ case RightOuter => (leftKeys, rightKeys)
+ case LeftOuter => (rightKeys, leftKeys)
+ case x =>
+ throw new IllegalArgumentException(
+ s"HashOuterJoin should not take $x as the JoinType")
+ }
+
+ protected[this] def supportUnsafe: Boolean = {
+ (self.codegenEnabled && joinType != FullOuter
+ && UnsafeProjection.canSupport(buildKeys)
+ && UnsafeProjection.canSupport(self.schema))
+ }
+
+ override def outputsUnsafeRows: Boolean = supportUnsafe
+ override def canProcessUnsafeRows: Boolean = supportUnsafe
+
+ protected[this] def streamedKeyGenerator(): Projection = {
+ if (supportUnsafe) {
+ UnsafeProjection.create(streamedKeys, streamedPlan.output)
+ } else {
+ newProjection(streamedKeys, streamedPlan.output)
+ }
+ }
+
+ @transient private[this] lazy val resultProjection: Projection = {
+ if (supportUnsafe) {
+ UnsafeProjection.create(self.schema)
+ } else {
+ new Projection {
--- End diff --
i think you just want scala's "identity" here
---
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]