Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22788#discussion_r226870804
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
 ---
    @@ -98,8 +98,18 @@ case class UnresolvedTableValuedFunction(
      */
     case class UnresolvedAttribute(nameParts: Seq[String]) extends Attribute 
with Unevaluable {
     
    -  def name: String =
    -    nameParts.map(n => if (n.contains(".")) s"`$n`" else n).mkString(".")
    +  def name: String = {
    +    nameParts.map(n =>
    +      if (n.contains(".")) s"`$n`"
    +      else {
    +        if (nameParts.length > 1) {
    +          s"`$n`"
    +        } else {
    +          n
    +        }
    +      }
    +    ).mkString(".")
    +  }
    --- End diff --
    
    Hi, @huaxingao . Can we have the following one-line patch instead 12 line 
changes?
    ```scala
    - nameParts.map(n => if (n.contains(".")) s"`$n`" else n).mkString(".")
    + nameParts.map(n => if (nameParts.length > 1 || n.contains(".")) s"`$n`" 
else n).mkString(".")
    ```
    
    cc @cloud-fan and @gatorsmile and @dbtsai .


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to