slachiewicz opened a new pull request, #2687: URL: https://github.com/apache/iceberg-go/pull/2687
Closes #2686. A Parquet file with a field ID at any depth is now resolved by ID alone, decided on the full file schema so the result does not depend on the projection. This follows the Column Projection wording in apache/iceberg#19037, which is not merged yet, hence the draft. What changes for a caller: - A scan no longer applies `schema.name-mapping.default` to such a file. A field without an ID, a list without an element ID and a map without a key or value ID are absent, with everything nested in them, and go through the existing missing-field path (partition value, `initial-default`, null). Filters and equality deletes see the same file schema. - `AddDataFilesByPath` returns `ErrInvalidSchema` for such a file. Column metrics cannot be keyed for a field without an ID, and metrics keyed by name would prune rows the scan reads as null. - Files with all field IDs or with none are read and added as before, including fields the name mapping lists without an ID (#2512). Paths that keep the old behavior: - `ArrowSchemaToIcebergWithOptions` still rejects a schema with only some IDs, so appends and writes never drop a column. - `table/inspect` resolves the `row` payload of a position delete file as before. Changing it needs a new exported function, which I left out. - A file registered by path before this change keeps the name-keyed metrics it was added with. Java reference: [`ParquetSchemaUtil.hasIds`](https://github.com/apache/iceberg/blob/main/parquet/src/main/java/org/apache/iceberg/parquet/ParquetSchemaUtil.java) and its use in [`ReadConf`](https://github.com/apache/iceberg/blob/main/parquet/src/main/java/org/apache/iceberg/parquet/ReadConf.java). Java fails on a list or map without child IDs; this PR returns null for the container, as #19037 words it. Tests: `TestScanDataFileWithPartialFieldIDs`, `TestScanDataFileWithPartialFieldIDsFilters` and `TestAddDataFilesByPathRejectsPartialFieldIDs` fail with the fix reverted. The filter cases also fail when columns under an absent struct or list are still read. `TestHasAnyFieldID` and `TestDropFieldsWithoutIDs` cover the nested shapes. Verified: a scan of `v2/partial-field-ids-parquet-data` from apache/iceberg-verification#27 → the rows of its `expected/scan.json`. Verified: `go test -race ./table/...` and `golangci-lint run ./table/...` (2.15.0) on macOS arm64 → pass. Not run: Linux, `apidiff`, and a rewrite (copy-on-write delete, compaction) of such a file, which I expect to write the absent fields as null. -- 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]
