hcrosse opened a new pull request, #2830: URL: https://github.com/apache/iceberg-go/pull/2830
## What Add a typed fast path inside `partitionExtractionPlan` for batches where every row maps to the same partition tuple, used by the partitioned fanout writer, clustered writer, and sort compaction. ## Why Previously, partitioned writes extracted a Go value, ran the partition transform, and built a partition key for every row in every batch. When a batch belongs to a single partition, such as compacted or pre-clustered time-series data, per-row extraction allocates per row and dominates write-side CPU time. The fast path evaluates row 0, then scans the remaining Arrow column buffers directly against the valid source-value range for identity, year, month, day, hour, truncate, and void transforms. If any row falls outside that range, mismatches nullability, or uses a source type that can raise a per-row conversion error, execution falls back to the existing per-row path so per-row validation semantics remain unchanged. On a 65,536-row batch benchmark on Apple M4 Max: | Partition Spec | Per-Row Path | Uniform Fast Path | Speedup | | --- | ---: | ---: | ---: | | `day(ts)` | 2.71 ms (131,098 allocs) | 18.8 us (6 allocs) | ~145x | | `identity(org_id), day(ts)` | 3.44 ms (131,103 allocs) | 186 us (7 allocs) | ~18.5x | ## Verification Unit, differential, and writer integration tests pass under the race detector across all supported transforms, null mixes, overflow boundaries, timezone units, and fallback cases. Cross-compilation for 32-bit Linux also passes. -- 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]
