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

    https://github.com/apache/spark/pull/15417#discussion_r83781091
  
    --- Diff: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveNaturalJoinSuite.scala
 ---
    @@ -31,39 +31,46 @@ class ResolveNaturalJoinSuite extends AnalysisTest {
       lazy val aNotNull = a.notNull
       lazy val bNotNull = b.notNull
       lazy val cNotNull = c.notNull
    +  lazy val aNew = newAttribute(a)
    +  lazy val bNotNullNew = newAttribute(bNotNull)
       lazy val r1 = LocalRelation(b, a)
       lazy val r2 = LocalRelation(c, a)
       lazy val r3 = LocalRelation(aNotNull, bNotNull)
       lazy val r4 = LocalRelation(cNotNull, bNotNull)
    +  lazy val r2New = LocalRelation(c, aNew)
    +  lazy val r4New = LocalRelation(cNotNull, bNotNullNew)
    +
    +  private def newAttribute(a: AttributeReference): Attribute =
    +    a.withExprId(NamedExpression.newExprId)
     
       test("natural/using inner join") {
         val naturalPlan = r1.join(r2, NaturalJoin(Inner), None)
         val usingPlan = r1.join(r2, UsingJoin(Inner, 
Seq(UnresolvedAttribute("a"))), None)
    -    val expected = r1.join(r2, Inner, Some(EqualTo(a, a))).select(a, b, c)
    +    val expected = r1.join(r2New, Inner, Some(EqualTo(a, aNew))).select(a, 
b, c)
    --- End diff --
    
    Previous `EqualTo(a, a)` introduces a conflicting attributes exception. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to