Re: [PR] [format] Drop ORC float bounds that hide NaN or -0.0 [paimon]
JingsongLi merged PR #10337: URL: https://github.com/apache/paimon/pull/10337 -- 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]
Re: [PR] [format] Drop ORC float bounds that hide NaN or -0.0 [paimon]
JingsongLi commented on PR #10337: URL: https://github.com/apache/paimon/pull/10337#issuecomment-6125564711 +1 -- 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]
Re: [PR] [format] Drop ORC float bounds that hide NaN or -0.0 [paimon]
kalayciburak commented on PR #10337: URL: https://github.com/apache/paimon/pull/10337#issuecomment-5996428618 yes, looked at both. Iceberg keeps lower/upper bounds for non-null, non-NaN values only, counts NaN separately (nan_value_counts), and does not allow NaN as a bound. -0.0 precedes +0.0, same as IEEE 754 totalOrder. The ORC hole is iceberg#1761: if the first value is NaN, ORC reports NaN for both bounds, and the evaluator treats that as unreliable so it does not skip the file. That landed in #2069. Delta drops float/double min/max when the parquet writer may omit NaN from the footer (Arrow, parquet-cpp). parquet-mr is trusted because it records NaN as the max. an unknown writer is treated as unsafe. ORC updates min/max with primitive < and >, so NaN and signed zero never replace a finite bound. we also don't have a nan count on these file stats. dropping the bound matches the Delta unsafe-writer path more than the Iceberg nan-count path. a missing bound is not used for skipping. if you'd rather keep the finite bounds and only skip when we know NaN was absent, that needs a nan count (or an unreliable flag) on the stats. I didn't add that here. say if you want that shape instead. -- 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]
Re: [PR] [format] Drop ORC float bounds that hide NaN or -0.0 [paimon]
JingsongLi commented on PR #10337: URL: https://github.com/apache/paimon/pull/10337#issuecomment-5995206857 From issue. It looks like someone really did run into the NaN issue. +1 to fix this. -- 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]
Re: [PR] [format] Drop ORC float bounds that hide NaN or -0.0 [paimon]
JingsongLi commented on PR #10337: URL: https://github.com/apache/paimon/pull/10337#issuecomment-5965878651 [P1] The signed-zero fix still skips positive zero when ORC reports a negative-zero upper bound. On head `c52330babf7b12668472001388daab973a2f06c0`, `OrcSimpleStatsExtractor.orcFloatingPointBoundsUnusable` (line 261) only rejects a `+0.0` minimum. Writing `[-1.0, -0.0, +0.0]` to a real ORC append table produces footer and manifest bounds `min=-1.0, max=-0.0`, with a finite sum, so this guard accepts the unsafe maximum. An unfiltered read preserves the positive-zero row, but `ReadBuilder.withFilter(equal(v, +0.0))` and `greaterThan(v, -0.0)` both plan zero splits and return no rows. I reproduced this for FLOAT and DOUBLE, with the default write batch size 1024, before and after an actual COMPACT commit. With two input files, the row-level oracle contains two matching rows in both cases. There is also a second pruning layer: in an isolated control that additionally rejects `max=-0.0`, the plan retains the file, but ORC SearchArgument row-group filtering still returns zero rows. Only the combined control—dropping the unsafe upper bound and declining signed-zero predicate pushdown in `OrcPredicateFunctionVisitor`—returns the expected rows. Please cover both layers with actual table-read regression tests; an extractor-only assertion does not verify the required end-to-end behavior. This is a remaining case of the existing bug described by #10334, not a new regression introduced by this PR. The current patch fixes the NaN cases in the same comparison, but leaves this signed-zero case unresolved. Validation: all 30 normal JDK 8 tests passed (`OrcFloatingPointStatsTest`, `OrcSimpleStatsExtractorTest`, `OrcFormatReadWriteTest`, `AppendOnlyTableFileMetaFilterTest`); the additional real-ORC matrix has 240 predicate queries, with 8 failures on this head and zero failures in the combined control. No production storage or credentials were used. -- 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]
[PR] [format] Drop ORC float bounds that hide NaN or -0.0 [paimon]
kalayciburak opened a new pull request, #10337: URL: https://github.com/apache/paimon/pull/10337 ### Purpose ORC records FLOAT and DOUBLE min/max with primitive comparisons. A NaN never replaces a finite bound, and -0.0 never replaces +0.0. `OrcSimpleStatsExtractor` copied those bounds into file stats, so a predicate could skip a file that still contained a matching row. When the ORC sum is NaN, or the recorded minimum is +0.0, the bounds are omitted. A missing bound is not used for skipping. Other finite bounds are unchanged. Omitting the bound when the minimum is +0.0 also drops a correct bound for a column whose smallest value really is +0.0. That is safer than a wrong bound. Reading the column back would keep that bound, at the cost of a scan. Fixes #10334 ### Tests `mvn -pl paimon-format -Pfast-build -DwildcardSuites=none -DfailIfNoTests=false -Dtest=OrcFloatingPointStatsTest,OrcSimpleStatsExtractorTest test` - Before the change, `OrcFloatingPointStatsTest` failed 4/4: max was 1.0 for a written NaN, min was +0.0 for a written -0.0. - After the change: `OrcFloatingPointStatsTest` 6/0, `OrcSimpleStatsExtractorTest` 5/0. -- 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]
