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

Fix schema pruning with correlated subqueries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0, 3.2.1, 3.3.0
    • 3.3.0, 3.2.2
    • SQL
    • None

    Description

      Schema pruning fails for some queries with correlated subqueries.

      sql(
        s"""SELECT name FROM contacts c
           |WHERE
           | EXISTS (SELECT 1 FROM ids i WHERE i.value = c.id)
           | AND
           | EXISTS (SELECT 1 FROM first_names n WHERE c.name.first = n.value)
           |""".stripMargin)
      
      [info]   org.apache.spark.SparkException: Failed to merge fields 'value' and 'value'. Failed to merge incompatible data types int and string
      [info]   at org.apache.spark.sql.errors.QueryExecutionErrors$.failedMergingFieldsError(QueryExecutionErrors.scala:936)
      

      Attachments

        Activity

          People

            aokolnychyi Anton Okolnychyi
            aokolnychyi Anton Okolnychyi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: