Initial Default values gets ignored for Struct columns
- Dominant language
- Java
- Stars
- 9.2k
- Forks
- 3.5k
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 129
Description
### Apache Iceberg version
All
### Query engine
All
### Please describe the bug 🐞
The initialDefault value in case of a Struct column is always null, but its fields can have default value, The Iceberg layer allows to set & store initialDefault values for the primitive fields of a Struct type. But doesn't honor them while reading.
For Paquet:
https://github.com/apache/iceberg/blob/c02d4676f38b834d6c672bb53abd34b07ebfddb9/parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetReaders.java#L289-L292
This code block checks whether the initialDefault is not null, for Struct type it will always be `null` but its fields can have default values.
It should check for the nested fields in case of struct or not allow having initialDefault values for sub fields of Struct type:
A sample screenshot:
The field Initial Default is `null` but the nested fields like `x` have an initial default of `100`, but this gets ignored
### Willingness to contribute
- [ ] I can contribute a fix for this bug independently
- [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- [ ] I cannot contribute a fix for this bug at this time
Contributor guide
Research direction
Start in parquet/src/main/java/org/apache/iceberg/data/parquet/BaseParquetReaders.java around lines 289-292, where the reader checks the struct column's initialDefault. Trace how nested primitive defaults are represented and read for a struct; the issue is done when those nested defaults are honored, or the unsupported combination is rejected consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100