Raviston6296 commented on PR #59574:
URL: https://github.com/apache/spark/pull/59574#issuecomment-6761842374
I went through the change for each operator and the bounds look right to me.
With `-0.0 < 0.0` in the formats' order, `lt(-0.0)`, `ltEq(0.0)`, `gt(0.0)` and
`gtEq(-0.0)` each keep exactly the values the Spark predicate keeps, so `NOT`
of each is exact too, which is the point of not widening the bounds. The Hive
ORC reader (`sql/hive/.../orc/OrcFileFormat`) goes through the same
`OrcFilters.createFilter`, so it is covered as well.
Two notes:
1. **The PR conflicts with master now**, in
`OrcFilters.buildLeafSearchArgument`. Since this branch was cut, SPARK-60397
and SPARK-60449 changed the leaf cases to guard on `canPushValue(name)` (which
also checks `acceptsValue` for the read schema) instead of
`dataTypeMap.contains(name)`, and added `TimestampType` cases for `=`, `<=>`,
`<=`, `>` and `IN` before the generic ones. After the rebase, the zero handling
would belong in the generic cases with the `canPushValue` guard. It doesn't
interact with the timestamp cases, since those only match `TimestampType`.
2. **On @ariel-miculas's NaN question:** I checked it on current master
(Parquet 1.18.1, ORC 2.3.1, default confs) by comparing `count()` with
`spark.sql.{parquet,orc}.filterPushdown` on and off. Each input was a single
file of `NaN` alone and of `NaN` with `0.5`, and the predicates were `f > 1.0`,
`f >= 1.0`, `f > 0.0`, `f < 1.0`, `NOT (f <= 1.0)`, `f != 0.5`, `f = CAST('NaN'
AS DOUBLE)` and `f IN (CAST('NaN' AS DOUBLE))`. None of them differed. In the
same run, a file of `-0.0` gave 0 instead of 1 for `f = 0` and `f >= 0` in both
formats, so the probe does catch this PR's bug. That covers only master's
Parquet. branch-4.x is still on Parquet 1.17.0, which as the description says
doesn't write `FLOAT`/`DOUBLE` statistics in the IEEE 754 total order, so NaN
would be worth checking separately there if this is backported.
--
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]