dbatomic commented on code in PR #45389:
URL: https://github.com/apache/spark/pull/45389#discussion_r1513002552
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:
##########
@@ -228,37 +235,46 @@ abstract class SparkStrategies extends
QueryPlanner[SparkPlan] {
// other choice.
case j @ ExtractEquiJoinKeys(joinType, leftKeys, rightKeys, nonEquiCond,
_, left, right, hint) =>
+ val hashJoinSupport = hashJoinSupported(leftKeys, rightKeys)
def createBroadcastHashJoin(onlyLookingAtHint: Boolean) = {
- val buildSide = getBroadcastBuildSide(
- left, right, joinType, hint, onlyLookingAtHint, conf)
- checkHintBuildSide(onlyLookingAtHint, buildSide, joinType, hint,
true)
- buildSide.map {
- buildSide =>
- Seq(joins.BroadcastHashJoinExec(
- leftKeys,
- rightKeys,
- joinType,
- buildSide,
- nonEquiCond,
- planLater(left),
- planLater(right)))
+ if (hashJoinSupport) {
+ val buildSide = getBroadcastBuildSide(
+ left, right, joinType, hint, onlyLookingAtHint, conf)
+ checkHintBuildSide(onlyLookingAtHint, buildSide, joinType, hint,
true)
+ buildSide.map {
+ buildSide =>
+ Seq(joins.BroadcastHashJoinExec(
+ leftKeys,
+ rightKeys,
+ joinType,
+ buildSide,
+ nonEquiCond,
+ planLater(left),
+ planLater(right)))
+ }
+ } else {
+ None
}
}
def createShuffleHashJoin(onlyLookingAtHint: Boolean) = {
- val buildSide = getShuffleHashJoinBuildSide(
- left, right, joinType, hint, onlyLookingAtHint, conf)
- checkHintBuildSide(onlyLookingAtHint, buildSide, joinType, hint,
false)
- buildSide.map {
- buildSide =>
- Seq(joins.ShuffledHashJoinExec(
- leftKeys,
- rightKeys,
- joinType,
- buildSide,
- nonEquiCond,
- planLater(left),
- planLater(right)))
+ if (hashJoinSupport) {
+ val buildSide = getShuffleHashJoinBuildSide(
+ left, right, joinType, hint, onlyLookingAtHint, conf)
+ checkHintBuildSide(onlyLookingAtHint, buildSide, joinType, hint,
false)
+ buildSide.map {
+ buildSide =>
+ Seq(joins.ShuffledHashJoinExec(
+ leftKeys,
+ rightKeys,
+ joinType,
+ buildSide,
+ nonEquiCond,
+ planLater(left),
+ planLater(right)))
+ }
+ } else {
Review Comment:
Yeah, this does make sense. Please check the latest iteration.
--
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]