gatorsmile commented on a change in pull request #23036: [SPARK-26065][SQL]
Change query hint from a `LogicalPlan` to a field
URL: https://github.com/apache/spark/pull/23036#discussion_r241929975
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/hints.scala
##########
@@ -44,11 +45,27 @@ case class ResolvedHint(child: LogicalPlan, hints:
HintInfo = HintInfo())
override def doCanonicalize(): LogicalPlan = child.canonicalized
}
+/**
+ * Hint that is associated with a [[Join]] node, with [[HintInfo]] on its left
child and on its
+ * right child respectively.
+ */
+case class JoinHint(
+ leftHint: Option[HintInfo],
+ rightHint: Option[HintInfo]) {
-case class HintInfo(broadcast: Boolean = false) {
+ override def toString: String = {
+ Seq(
+ leftHint.map("leftHint=" + _),
+ rightHint.map("rightHint=" + _))
+ .filter(_.isDefined).map(_.get).mkString(", ")
+ }
+}
- /** Must be called when computing stats for a join operator to reset hints.
*/
- def resetForJoin(): HintInfo = copy(broadcast = false)
+object JoinHint {
+ val NONE = JoinHint(None, None)
+}
+
+case class HintInfo(broadcast: Boolean = false) {
Review comment:
Needs comments `@param` for describing what is `broadcast`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]