peter-toth opened a new pull request, #39676:
URL: https://github.com/apache/spark/pull/39676

   ### What changes were proposed in this pull request?
   This is a small correctness fix to 
`DataSourceUtils.getPartitionFiltersAndDataFilters()` to handle filters without 
any referenced attributes correctly. E.g. without the fix the following query 
on ParquetV2 source:
   ```
   spark.conf.set("spark.sql.sources.useV1SourceList", "")
   spark.range(1).write.mode("overwrite").format("parquet").save(path)
   df = spark.read.parquet(path).toDF("i")
   f = udf(lambda x: False, "boolean")(lit(1))
   val r = df.filter(f)
   r.show()
   ```
   returns
   ```
   +---+
   |  i|
   +---+
   |  0|
   +---+
   ```
   but it should return with empty results.
   The root cause of the issue is that during `V2ScanRelationPushDown` a filter 
that doesn't reference any column incorrectly identified as partition filter.
   
   ### Why are the changes needed?
   To fix a correctness issue.
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, fixes a correctness issue.
   
   ### How was this patch tested?
   Added new UT.
   


-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to