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

Scan DataSource with predicate expression combine partition key and attributes doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.5.2, 1.6.0
    • SQL
    • None

    Description

      To reproduce that with the code:

      withSQLConf(SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> "true") {
            withTempPath { dir =>
              val path = s"${dir.getCanonicalPath}/part=1"
              (1 to 3).map(i => (i, i.toString)).toDF("a", "b").write.parquet(path)
      
              // If the "part = 1" filter gets pushed down, this query will throw an exception since
              // "part" is not a valid column in the actual Parquet file
              checkAnswer(
                sqlContext.read.parquet(path).filter("a > 0 and (part = 0 or a > 1)"),
                (2 to 3).map(i => Row(i, i.toString, 1)))
            }
          }
      

      We expect the result as:

      2, 1
      3, 1
      

      But we got:

      1, 1
      2, 1
      3, 1
      

      Attachments

        Activity

          People

            chenghao Cheng Hao
            chenghao Cheng Hao
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: