feichai0017 commented on PR #20945: URL: https://github.com/apache/datafusion/pull/20945#issuecomment-4071991070
> What about `Struct(a: List(x: Int64))` vs `Struct(a: List(y: Int64))` -- should we try to elide the cast in this case as well?那 `Struct(a: List(x: Int64))` 和 `Struct(a: List(y: Int64))呢——` 在这种情况下我们也应该尝试省略角色吗? > > It might be helpful to add an SLT test to verify the end-user behavior that the extraneous casts are indeed omitted.添加一个 SLT 测试可能会有帮助,以验证终端用户行为是否确实省略了多余的铸造。 Thanks, I updated the matcher to make that boundary explicit. The fast-path match now: - ignores wrapper field names for list-like types and maps, where the wrapper name does not affect the physical representation - recurses through `Struct`, while still requiring struct field names/order/nullability to match exactly That means cases like `Struct(a: List(x: Int64))` vs `Struct(a: List(y: Int64))` now avoid the extra cast, but broader `Struct` reordering still does not. I also added: - analyzer regressions for both `Struct(...List(...))` and `Map(...)` - an `EXPLAIN VERBOSE` sqllogictest in `spark/array/array.slt` to verify the user-visible behavior that no extra cast is introduced during type coercion -- 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]
