sunchao commented on code in PR #6428:
URL: https://github.com/apache/datafusion-comet/pull/6428#discussion_r4179009063
##########
native/core/src/execution/planner.rs:
##########
@@ -1291,6 +1364,20 @@ impl PhysicalPlanner {
if !nested || lt.equals_datatype(&rt) {
return (left, right);
}
+ // Catalyst compares struct values by ordinal, even when their field
names differ.
+ // A name-based Arrow cast would change the values being compared.
+ if let Some(target) = Self::positional_nullability_union(<, &rt) {
Review Comment:
Changed the early-return guard to exact equality (`lt == rt`). Added a
native Range regression for equally non-nullable structs with swapped names,
both directly and inside arrays. The rows for id=1 and id=2 produce true and
false respectively, so the test also catches accidental name-based reordering.
The new query fails with `Nested predicate requires matching types` using
the prior-head (`8580cb00400`) JNI library and passes with the rebuilt library.
Both named-struct SQL fixtures pass on Spark 4.1.3; Spark 3.5.9 strict
main/test compilation and both fixture tests also pass, with the different-name
fixture gated out there. Rust formatting, Spotless and Scalastyle pass. Broader
current-head CI remains pending.
--
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]