anshulbaliga7 opened a new pull request, #58086: URL: https://github.com/apache/spark/pull/58086
### What changes were proposed in this pull request? Fix `ResolveInsertionBase` to resolve struct fields positionally at every nesting level during `INSERT INTO table (column_list)`, including structs inside `ArrayType` and `MapType`. Fixes https://issues.apache.org/jira/browse/SPARK-58816 ### Why are the changes needed? `createProjectForByNameQuery` only dispatched to the rename path when the top-level column was `StructType`, and `renameFieldsInStruct` only recursed into nested `StructType` fields. Structs inside arrays and maps were left unrenamed, causing `TableOutputResolver` to resolve them by name instead of position — silently writing values into wrong fields when source and target field order differs. ### Does this PR introduce any user-facing change? Yes. `INSERT INTO table (column_list)` now consistently resolves struct fields positionally at all nesting levels (direct struct, array-of-struct, map-of-struct), fixing silent data corruption when source and target field order differs. ### How was this patch tested? Added three regression tests in `SQLInsertTestSuite` covering: - Array-of-struct positional resolution - Map-of-struct positional resolution - Combined direct struct + array-of-struct + map-of-struct (exact JIRA repro) ### Was this patch authored or co-authored using generative AI tooling? No. -- 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]
