vinodkc commented on code in PR #41875:
URL: https://github.com/apache/spark/pull/41875#discussion_r1257324222
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/joins/HashJoin.scala:
##########
@@ -766,4 +598,331 @@ object HashJoin extends CastSupport with SQLConfHelper {
ansiEnabled = false)
}
}
+
+ private def streamedBoundKeys(streamedKeys: Seq[Expression], streamedOutput:
Seq[Attribute]) =
+ bindReferences(HashJoin.rewriteKeyExpr(streamedKeys), streamedOutput)
+ private def streamSideKeyGenerator(
+ streamedKeys: Seq[Expression],
+ streamedOutput: Seq[Attribute]): UnsafeProjection =
+ UnsafeProjection.create(streamedBoundKeys(streamedKeys, streamedOutput))
+
+ def boundCondition(
+ condition: Option[Expression],
+ joinType: JoinType,
+ buildSide: BuildSide,
+ buildPlanOutput: Seq[Attribute],
+ streamedPlanOutput: Seq[Attribute]): InternalRow => Boolean = if
(condition.isDefined) {
+ if (joinType == FullOuter && buildSide == BuildLeft) {
+ // Put join left side before right side. This is to be consistent with
+ // `ShuffledHashJoinExec.fullOuterJoin`.
+ Predicate.create(condition.get, buildPlanOutput ++
streamedPlanOutput).eval _
+ } else {
+ Predicate.create(condition.get, streamedPlanOutput ++
buildPlanOutput).eval _
+ }
+ } else { (r: InternalRow) =>
+ true
+ }
+
+ private def createResultProjection(joinType: JoinType,
+ output: Seq[Attribute],
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]