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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]