bujjibabukatta opened a new pull request, #17844:
URL: https://github.com/apache/iceberg/pull/17844
### Summary
Proposes one direction for #17463 (open investigation issue, no
consensus yet): let ORC surface struct-level null counts it already
computes, and let V4 content stats store them.
### Root Cause
- **ORC**: `ColumnStatistics[]` includes real null-count data for
struct columns, but `StatsColumnsVisitor.record()` only ever added
children's field IDs — the struct's own ID was discarded.
- **V4 stats**: `fieldStatsStruct()` excluded all nested types
(struct, map, list) uniformly via `isNestedType()`, so structs had
no way to store counts even when a writer could supply them.
Read side is unaffected — `InclusiveMetricsEvaluator` already does a
generic field-ID lookup with no leaf/struct distinction.
### Fix
- `OrcMetrics.java` — `StatsColumnsVisitor.record()` now also adds
the struct's own field ID via `ORCSchemaUtil.icebergID(record)`.
Bounds unaffected (struct `ColumnStatistics` matches no
`instanceof` branch in `fromOrcMin`/`fromOrcMax`).
- `StatsUtil.java` — `fieldStatsStruct()` returns a reduced
`value_count`/`null_value_count`-only struct for `StructType`
instead of `null`. Map/list still excluded as before.
--
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]