gripleaf opened a new pull request, #301: URL: https://github.com/apache/paimon-cpp/pull/301
### Purpose Linked issue: None. Reduce redundant work in batch predicate evaluation through three optimizations: - **Candidate-row evaluation:** Evaluate AND children only on remaining matches and OR children only on remaining non-matches. Gather only the referenced column and skip index rewriting when the candidate set remains unchanged. Preserve eager evaluation where skipping rows could hide errors. - **Field bounds checks:** Use `StructArray::num_fields()` instead of `fields().size()` to avoid materializing unrelated column wrappers. - **Typed equality:** Compare supported Arrow values directly without constructing per-row Literals. Preserve the existing path for unsupported types and cases requiring the original conversion semantics. Synthetic benchmark results: 8,192 rows, an equality predicate combined with 16 OR equality predicates; median of six rounds, ten evaluations per round. | Leading predicate match rate | Original | Optimized | Speedup | | --- | ---: | ---: | ---: | | 1 / 8192 | 16.388 ms | 0.086 ms | 191× | | 1 / 16 | 16.126 ms | 0.215 ms | 75× | | All rows | 16.084 ms | 0.584 ms | 27.5× | These are batch-evaluation microbenchmarks, not end-to-end read latencies. Candidate selection still adds approximately 8.5% overhead compared with eager typed equality when all rows match. No separate numerical benefit is claimed for the bounds-check optimization. ### Tests Passed: - 1,555 common tests, including 57 predicate tests. - 220 Parquet tests. - 3 cross-module Predicate ABI tests. - Opt-in batch-evaluation microbenchmark, checking result equivalence on every iteration. - Changed-file pre-commit checks and `git diff --check`. Regression coverage includes nested AND/OR predicates, empty selections, slices, NULLs, dictionary columns, field bounds, error preservation, typed equality equivalence, binary values and floating-point fallbacks. Validation used Linux x86_64, Release, C++17 and GCC 13.3. An unchanged `fields_comparator_test.cpp` triggered a GCC internal compiler error and was compiled separately with Clang 18. The build environment also required shared libunwind. Neither workaround modifies repository files. Debug, sanitizer and aarch64 builds were not run locally. ### API and Format No changes to public headers under `include/paimon/`, storage formats or protocols. Selection-aware methods are internal implementation details. ### Documentation No new user-facing configuration or feature. Internal comments document selection semantics, eager fallbacks and supported typed equality paths. ### Generative AI tooling Generated-by: OpenAI Codex (GPT-5) -- 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]
