wangyum commented on code in PR #59027:
URL: https://github.com/apache/spark/pull/59027#discussion_r4273293686
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala:
##########
@@ -410,8 +440,26 @@ abstract class SparkStrategies extends
QueryPlanner[SparkPlan] {
}
}
+ def createRangeJoin(hintOnly: Boolean) = {
+ if (!conf.broadcastRangeJoinEnabled) {
+ None
+ } else {
+ plan match {
+ case ExtractRangeJoinKeys(_, _, leftKeys, rightKeys, _,
rangeJoin) =>
+ val allowed = BroadcastRangeJoinExec.supports(joinType, _:
BuildSide)
+ broadcastSide(hintOnly, allowed).map { buildSide =>
+ Seq(BroadcastRangeJoinExec(
+ planLater(left), planLater(right), buildSide, joinType,
+ leftKeys, rightKeys, condition, rangeJoin))
+ }
+ case _ => None
+ }
+ }
+ }
+
def createJoinWithoutHint() = {
- createBroadcastNLJoin(false)
+ createRangeJoin(hintOnly = false)
Review Comment:
Yes, keeping BNLJ as the unhinted last-resort fallback is intentional.
Because the interval index structure carries additional overhead compared to
raw rows, broadcasting a large table near `maxBroadcastTableSize` without an
explicit user hint could trigger `tooLargeToBroadcast` failures for queries
that previously succeeded under BNLJ.
--
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]