maryannxue commented on a change in pull request #24164: [SPARK-27225][SQL]
Implement join strategy hints
URL: https://github.com/apache/spark/pull/24164#discussion_r272667459
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/EliminateResolvedHint.scala
##########
@@ -40,17 +40,16 @@ object EliminateResolvedHint extends Rule[LogicalPlan] {
}
private def mergeHints(hints: Seq[HintInfo]): Option[HintInfo] = {
- hints.reduceOption((h1, h2) => HintInfo(
- broadcast = h1.broadcast || h2.broadcast))
+ hints.reduceOption((h1, h2) => h1.merge(h2))
Review comment:
There is no behavior change here. There cannot be, coz we only had one hint
before this PR, so a broadcast + broadcast = broadcast. The new behavior is
defined in the description of this PR:
> Conflicts within either side of the join: take the first strategy hint
specified in the query, or the top hint node in Dataset. For example, in
"select /*+ merge(t1) / /+ broadcast(t1) */ k1, v2 from t1 join t2 on t1.k1 =
t2.k2", take "merge(t1)"; in df1.hint("merge").hint("shuffle_hash").join(df2),
take "shuffle_hash". This is a general hint conflict resolving strategy, not
specific to join strategy hint.
The merge function is implemented in HintInfo, which should be responsible
for deciding the strategy of merging hints between a node on top and a node on
the bottom.
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]