malinjawi opened a new pull request, #12956: URL: https://github.com/apache/gluten/pull/12956
### What changes were proposed in this pull request? `IcebergWriter` trusted the incoming field-id proto and indexed it positionally, so a proto that disagreed with the Velox row type was an out-of-bounds read rather than an error. Velox only checks arity shallowly and stops recursing at non-ROW array elements, so `ARRAY<ARRAY<T>>` and `ARRAY<MAP<K,V>>` reach an unguarded `.at(0)` inside Velox instead of a diagnostic. This adds a shared resolver that validates a decoded field-id tree against the write schema at every depth — arity, kind, name, strictly positive ids, and ids unique across the whole tree — then lowers it to what `ParquetWriterOptions` expects. Call sites use `.at(i)`, so a residual mismatch throws. The uniqueness check is the one that matters beyond crash safety: Iceberg requires table-global unique ids, so two sibling structs each carrying id 5 would otherwise produce a well-formed footer that resolves to the wrong column. ### How was this patch tested? New `ParquetFieldIdsTest.cc` covers primitives, nested structs, arrays, maps, array-of-struct, nested arrays, name-less resolution, absent ids and the empty tree. ### Notes Draft — I haven't been able to run the C++ locally, so I'd like CI to build it first. The `ParquetFieldIdSchema` decoder is currently only reached from tests; it's the intended entry point for the Delta write path and lands with the follow-up, so say the word if you'd rather it came later instead. -- 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]
