hcrosse opened a new pull request, #2831: URL: https://github.com/apache/iceberg-go/pull/2831
## What Add a cached schema projector inside `RollingDataWriter` that reuses a computed projection plan across Arrow record batches sharing the same input schema. ## Why Writing Arrow batches through `RollingDataWriter` previously ran full recursive schema projection on every batch, even when incoming batches already matched the table layout and only differed in field metadata or nested element names. The cached projector classifies each input schema into one of three tiers: 1. Identity passthrough when the input schema matches the validated target Arrow schema and file-schema alignment holds. 2. Zero-copy relabeling that reuses the underlying Arrow array buffers and only replaces schema metadata and nested field names when types and field-ID alignments match. 3. Fallback to full `toRequestedSchema` projection whenever casts, column reordering, defaults, missing fields, or variant transformations are needed. On a 69-column nested schema benchmark (1,024 rows) on Apple M4 Max, per-batch projection dropped from 129 us (285.6 KB, 3,900 allocs) to 8.0 us (15.1 KB, 201 allocs), roughly 16x faster with 19x fewer allocations. ## Verification Unit, differential parity, and writer tests pass under the race detector and checked Arrow allocator, covering schema caching, nested list and map relabeling, swapped same-typed columns, oversized slices, dictionary fields, and variant types. -- 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]
