thswlsqls opened a new pull request, #16922:
URL: https://github.com/apache/iceberg/pull/16922

   ## Summary
   
   - `OrcMetrics.fromOrcMin/fromOrcMax` always converted ORC 
`TimestampColumnStatistics` to microseconds.
   - But `Conversions` reads/writes `timestamp_ns` (`TIMESTAMP_NANO`) bounds as 
raw nanoseconds (`api/.../types/Conversions.java`, TIMESTAMP_NANO cases).
   - The mismatch made `timestamp_ns` file bounds ~1000x too small, so file 
pruning could skip files that hold matching rows.
   - Fix: convert the bound to nanoseconds for `TIMESTAMP_NANO`; keep 
microseconds for `TIMESTAMP` (backward compatible).
   - Related work on this type: predicate pushdown #16609 (did not touch 
OrcMetrics).
   
   ## Testing done
   
   - Added `TestOrcMetrics#timestampNanoBoundsKeepNanoPrecision`: writes a 
`timestamp_ns` column with sub-microsecond nanos and asserts the decoded 
lower/upper bounds equal the nanosecond value (not the truncated micros). Fails 
before the fix (lower bound `1` instead of `1500`), passes after.
   - `./gradlew :iceberg-orc:check` and `:iceberg-data:test --tests 
"org.apache.iceberg.orc.TestOrcMetrics"` pass (84 tests, 0 failures). Both 
changed methods are private, so revapi stays backward compatible. Integration 
tests not run.
   
   ---
   **AI Disclosure**
   - Model: claude-opus-4-8[1m]
   - Platform/Tool: Claude Code
   - Human Oversight: fully reviewed (human reviews and submits)
   - Prompt Summary: Fix OrcMetrics so timestamp_ns column bounds are encoded 
as nanoseconds, matching Conversions, and add 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to