huan233usc opened a new pull request, #874:
URL: https://github.com/apache/iceberg-cpp/pull/874
## What
Adds an end-to-end test for v3 column default values: write a real Parquet
file, evolve the schema through `UpdateSchema` to add a column with an
`initial-default`, then read the pre-evolution file back using the schema that
evolution actually produced and assert the old rows materialize the default.
## Why
The existing default-value coverage stops short of this seam:
- the read-path tests (`ParquetReaderTest.ReadMissingFieldsWithDefaults`,
the Avro equivalents) build the projected schema **by hand**, so they never
exercise a schema that `UpdateSchema` produced;
- the evolution tests (`UpdateSchemaDefaultValueTest.*`) assert on the
resulting schema but never write or read a data file.
So nothing covered "evolution emits a defaulted field → the reader fills it
for rows written before the column existed", which is the behaviour users
actually depend on.
## How
The test runs on the existing `UpdateSchemaDefaultValueTest` fixture (v3
metadata, in-memory catalog, mock `FileIO`), which already provides a table
plus a writable IO:
1. write `[[1,2,3],[4,5,6]]` to a Parquet file using the table's current
schema (`x`, `y`, `z`);
2. `AddColumn("added", int64(), ..., Literal::Long(42))` and `Commit()`;
3. reload the table, confirm the committed field carries the
`initial-default`;
4. open the original file with the evolved schema and compare against
`[[1,2,3,42],[4,5,6,42]]`.
`parquet::RegisterAll()` is called from `SetUpTestSuite` so the
writer/reader factories are available (the target already builds with
`USE_BUNDLE`).
## Testing
`table_update_test` passes (809 tests). Verified the test is meaningful by
dropping the default from the evolution step, which makes it fail rather than
silently pass.
--
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]