Github user skambha commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17185#discussion_r207635526
  
    --- 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 --
    
    The database information gets carried over based on the lookupRelation 
logic.  Details are in Section 3.3.3 in the design doc 
[here](https://drive.google.com/file/d/1zKm3aNZ3DpsqIuoMvRsf0kkDkXsAasxH/view)


---

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

Reply via email to