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

    https://github.com/apache/spark/pull/17185#discussion_r207104014
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/unresolved.scala
 ---
    @@ -262,17 +262,47 @@ abstract class Star extends LeafExpression with 
NamedExpression {
      */
     case class UnresolvedStar(target: Option[Seq[String]]) extends Star with 
Unevaluable {
     
    -  override def expand(input: LogicalPlan, resolver: Resolver): 
Seq[NamedExpression] = {
    +  /**
    +   * Returns true if the nameParts match the qualifier of the attribute
    +   *
    +   * There are two checks: i) Check if the nameParts match the qualifier 
fully.
    +   * E.g. SELECT db.t1.* FROM db1.t1   In this case, the nameParts is 
Seq("db1", "t1") and
    +   * qualifier of the attribute is Seq("db1","t1")
    +   * ii) If (i) is not true, then check if nameParts is only a single 
element and it
    +   * matches the table portion of the qualifier
    +   *
    +   * E.g. SELECT t1.* FROM db1.t1  In this case nameParts is Seq("t1") and
    +   * qualifier is Seq("db1","t1")
    +   * SELECT a.* FROM db1.t1 AS a
    +   * In this case nameParts is Seq("a") and qualifier for
    +   * attribute is Seq("a")
    +   */
    +  private def matchedQualifier(
    +      attribute: Attribute,
    --- End diff --
    
    do we assume the attribute always carry the full qualifier? and i.e. the 
analyzer will always include the current database in the qualifier.


---

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

Reply via email to