Skip to content

Commit

Permalink
[GLUTEN-3979][CORE] Use exists() instead of map().exists() to improve…
Browse files Browse the repository at this point in the history
… code readability (#3980)
  • Loading branch information
dcoliversun authored Dec 8, 2023
1 parent d11a61b commit fb7c48e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ case class JoinSelectionOverrides(session: SparkSession)
plan match {
case plan: Join =>
if ((count + 1) >= GlutenConfig.getConf.logicalJoinOptimizationThrottle) return true
plan.children.map(existsMultiJoins(_, count + 1)).exists(_ == true)
plan.children.exists(existsMultiJoins(_, count + 1))
case plan: Project =>
if ((count + 1) >= GlutenConfig.getConf.logicalJoinOptimizationThrottle) return true
plan.children.map(existsMultiJoins(_, count + 1)).exists(_ == true)
plan.children.exists(existsMultiJoins(_, count + 1))
case other => false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,10 @@ case class FallbackMultiCodegens(session: SparkSession) extends Rule[SparkPlan]
plan match {
case plan: CodegenSupport if plan.supportCodegen =>
if ((count + 1) >= optimizeLevel) return true
plan.children.map(existsMultiCodegens(_, count + 1)).exists(_ == true)
plan.children.exists(existsMultiCodegens(_, count + 1))
case plan: ShuffledHashJoinExec =>
if ((count + 1) >= optimizeLevel) return true
plan.children.map(existsMultiCodegens(_, count + 1)).exists(_ == true)
plan.children.exists(existsMultiCodegens(_, count + 1))
case other => false
}

Expand Down

0 comments on commit fb7c48e

Please sign in to comment.