Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18189#discussion_r120296682
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/hints.scala
 ---
    @@ -51,19 +51,17 @@ case class ResolvedHint(child: LogicalPlan, hints: 
HintInfo = HintInfo())
     }
     
     
    -case class HintInfo(
    -    isBroadcastable: Option[Boolean] = None) {
    +case class HintInfo(broadcast: Boolean = false) {
     
       /** Must be called when computing stats for a join operator to reset 
hints. */
    -  def resetForJoin(): HintInfo = copy(
    -    isBroadcastable = None
    -  )
    +  def resetForJoin(): HintInfo = copy(broadcast = false)
     
       override def toString: String = {
    -    if (productIterator.forall(_.asInstanceOf[Option[_]].isEmpty)) {
    -      "none"
    -    } else {
    -      isBroadcastable.map(x => s"isBroadcastable=$x").getOrElse("")
    +    val hints = scala.collection.mutable.ArrayBuffer.empty[String]
    +    if (broadcast) {
    +      hints += "broadcast"
         }
    +
    +    if (hints.isEmpty) "none" else hints.mkString("(", ", ", ")")
    --- End diff --
    
    now when users run `EXPLAIN COST`, the displayed statistics will be 
something like `Statistics(sizeInBytes=800.0 B, hints=(broadcast)`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to