Repository navigation
Conversation
Remove trailing ASCII spaces from CHAR values, including nested fields. Keep VARCHAR values intact and bypass statistics that compare padded data. Normalize decoded values before evaluating residual predicates. Co-Authored-By: Codex <noreply@openai.com> AI-Model: gpt-6 AI-Contributed/Feature: 146/146 AI-Contributed/UT: 0/0
JingsongLi
left a comment
There was a problem hiding this comment.
Decoding padded ORC CHAR values has a concrete interoperability benefit. The 29 ORC tests passed, and a real ORC CHAR(4) fixture returned the correct equality match, nested element and untouched VARCHAR. The table-scan regression below still drops that match with Java-style file statistics.
| (Datum::Double(value), DataType::Double(_)) => Some(PredicateValue::Float64(Some(*value))), | ||
| (Datum::String(value), DataType::Char(_) | DataType::VarChar(_)) => { | ||
| // CHAR values are normalized before residual evaluation; raw padded ORC | ||
| // statistics must not exclude a matching unpadded value. |
There was a problem hiding this comment.
[P1] Prevent manifest statistics from dropping padded CHAR matches before the ORC reader opens the file. Java's OrcSimpleStatsExtractor copies the raw string bounds into file metadata. I confirmed that a physical CHAR(4) file stores an AB value as AB in its stats. I wrote a table with the same padded values, committed its file with Java-style bounds (AB to CD ), and planned code = 'AB'. The plan contained zero splits, although the direct ORC read correctly returned AB. Make table-level file pruning fail open for these CHAR comparisons or use safe normalized bounds, and exercise the full TableScan path in a regression test.
Purpose
Closes #1515.
Make a padded ORC
CHARvalue compare the same way as the logical Paimon value, including when a predicate is evaluated during the read.Brief change log
CHARliterals. Evaluate residual predicates on the normalized values.Tests
Added a sliced-array case covering nulls, leading spaces, all-padding values, tabs, nonbreaking spaces and the same inputs read as VARCHAR.
Local verification passed with
cargo build --locked -p paimon --libandcargo fmt --all -- --check. Test execution is left to upstream CI.API and Format
The change affects decoded ORC CHAR values and predicates on them. It uses the existing read API and file format.
Documentation
The behavior follows the fixed-width CHAR semantics of the Java reader.