Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-39672

NotExists subquery failed with conflicting attributes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.3
    • 3.1.4, 3.2.2, 3.3.1, 3.4.0
    • SQL
    • None

    Description

      select * from
      (
      select v1.a, v1.b, v2.c
      from v1
      inner join v2
      on v1.a=v2.a) t3
      where not exists (
        select 1
        from v2
        where t3.a=v2.a and t3.b=v2.b and t3.c=v2.c
      )

      This query throws AnalysisException

      org.apache.spark.sql.AnalysisException: Found conflicting attributes a#266 in the condition joining outer plan:
        Join Inner, (a#250 = a#266)
      :- Project [_1#243 AS a#250, _2#244 AS b#251]
      :  +- LocalRelation [_1#243, _2#244, _3#245]
      +- Project [_1#259 AS a#266, _3#261 AS c#268]
         +- LocalRelation [_1#259, _2#260, _3#261]and subplan:
        Project [1 AS 1#273, _1#259 AS a#266, _2#260 AS b#267, _3#261 AS c#268#277]
      +- LocalRelation [_1#259, _2#260, _3#261] 

      Attachments

        Activity

          People

            mauzhang Manu Zhang
            mauzhang Manu Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: