cloud-fan commented on a change in pull request #29726:
URL: https://github.com/apache/spark/pull/29726#discussion_r487866106
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/dynamicpruning/PartitionPruning.scala
##########
@@ -196,6 +198,25 @@ object PartitionPruning extends Rule[LogicalPlan] with
PredicateHelper {
case _ => false
}
+ /**
+ * For some filtering side can not broadcast by join type but can broadcast
by size,
+ * then we should not consider reuse broadcast only, for example:
+ * Left outer join and left side very small.
+ */
+ private def isReuseBroadcastOnly(
+ canBuildBroadcast: Boolean,
+ hasBenefit: Boolean,
+ hintToBroadcastPruningSide: Boolean,
+ pruningPlan: LogicalPlan,
+ filteringPlan: LogicalPlan): Boolean = {
+ if (canBuildBroadcast) {
+ !hasBenefit || SQLConf.get.dynamicPartitionPruningReuseBroadcastOnly
+ } else {
+ !(hasBenefit && canBroadcastBySize(filteringPlan, SQLConf.get) &&
+ !hintToBroadcastPruningSide && !canBroadcastBySize(pruningPlan,
SQLConf.get))
Review comment:
`!canBroadcastBySize(pruningPlan, SQLConf.get)` do we need this
condition?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]