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

    https://github.com/apache/spark/pull/17185#discussion_r207105608
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/namedExpressions.scala
 ---
    @@ -71,19 +71,27 @@ trait NamedExpression extends Expression {
        * multiple qualifiers, it is possible that there are other possible way 
to refer to this
        * attribute.
        */
    -  def qualifiedName: String = (qualifier.toSeq :+ name).mkString(".")
    +  def qualifiedName: String = {
    +    if (qualifier.isDefined) {
    +      (qualifier.get :+ name).mkString(".")
    +    } else {
    +      name
    +    }
    +  }
     
       /**
        * Optional qualifier for the expression.
    +   * Qualifier can also contain the fully qualified information, for e.g, 
Sequence of string
    +   * containing the database and the table name
        *
        * For now, since we do not allow using original table name to qualify a 
column name once the
        * table is aliased, this can only be:
        *
        * 1. Empty Seq: when an attribute doesn't have a qualifier,
        *    e.g. top level attributes aliased in the SELECT clause, or column 
from a LocalRelation.
    -   * 2. Single element: either the table name or the alias name of the 
table.
    +   * 2. Seq with a Single element: either the table name or the alias name 
of the table.
    --- End diff --
    
    3. a seq of 2 elements: database name and table name.


---

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

Reply via email to