JingsongLi commented on code in PR #1516:
URL: https://github.com/apache/paimon-rust/pull/1516#discussion_r4665220954


##########
crates/paimon/src/arrow/format/orc.rs:
##########
@@ -718,7 +832,9 @@ fn datum_to_orc_value(datum: &Datum, data_type: &DataType) 
-> Option<PredicateVa
         (Datum::Long(value), DataType::BigInt(_)) => 
Some(PredicateValue::Int64(Some(*value))),
         (Datum::Float(value), DataType::Float(_)) => 
Some(PredicateValue::Float32(Some(*value))),
         (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.

Review 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.



-- 
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]

Reply via email to