cloud-fan commented on a change in pull request #32355:
URL: https://github.com/apache/spark/pull/32355#discussion_r683386765
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala
##########
@@ -139,6 +141,36 @@ abstract class SparkStrategies extends
QueryPlanner[SparkPlan] {
object JoinSelection extends Strategy
with PredicateHelper
with JoinSelectionHelper {
+ private val hintErrorHandler = conf.hintErrorHandler
+
+ private def checkHintBuildSide(
+ onlyLookingAtHint: Boolean,
+ buildSide: Option[BuildSide],
+ joinType: JoinType,
+ hint: JoinHint,
+ isBroadcast: Boolean): Unit = {
+ if (onlyLookingAtHint && buildSide.isEmpty) {
+ if ((isBroadcast && hintToBroadcastLeft(hint)) ||
Review comment:
the code looks a bit messy, we can clearly show the branches:
```
def invalidBuildSideInHint(buildSide: String) = {
hintErrorHandler.joinHintNotSupported(hint.leftHint.get,
s"build $buildSide for ${joinType.sql.toLowerCase(Locale.ROOT)} join")
}
if (onlyLookingAtHint && buildSide.isEmpty) {
if (broadcast) {
// check broadcast hash join
if (hintToBroadcastLeft) invalidBuildSideInHint("left")
if (hintToBroadcastRight) invalidBuildSideInHint("right")
} else {
// check shuffle hash join
...
}
}
```
--
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]