You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/08/12 06:36:20 UTC

[GitHub] [spark] sunchao commented on a diff in pull request #37419: [SPARK-39833][SQL] Fix a rare correctness issue with count() in the case of overlapping partition and data columns in Parquet DSv1

sunchao commented on code in PR #37419:
URL: https://github.com/apache/spark/pull/37419#discussion_r944155079


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala:
##########
@@ -1108,6 +1108,17 @@ abstract class ParquetQuerySuite extends QueryTest with ParquetTest with SharedS
       checkAnswer(sql("select * from tbl"), expected)
     }
   }
+
+  test("SPARK-39833: count() with pushed filters from Parquet files") {

Review Comment:
   What if we change this test to:
   ```scala
     test("SPARK-39833-2: count() with pushed filters from Parquet files") {
       withTempPath { path =>
         val p = s"${path.getCanonicalPath}${File.separator}col=0${File.separator}"
         Seq((0, "a")).toDF("COL", "b").coalesce(1).write.save(p)
         val df = spark.read.parquet(path.getCanonicalPath)
         checkAnswer(df.filter("col = 0"), Seq(Row(0, "a")))
         assert(df.filter("col = 0").select('b).collect().toSeq == Row("a") :: Nil)
       }
     }
   ```
   
   it seems checking whether `requestedSchema` is empty is not sufficient enough, since it can be non-empty but the pushed filter could reference column that do not exist in it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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