liupoyi-1031 opened a new pull request, #6501:
URL: https://github.com/apache/datafusion-comet/pull/6501

   ## Which issue does this PR close?
   
   Closes #6200.
   
   ## Rationale for this change
   
   `CometCast.isSupported` combined nested child support by returning the first 
non-`Compatible` result. That happened for struct → struct, struct → string, 
and map (key before value). When an earlier child was `Incompatible` and a 
later one was `Unsupported`, the whole cast reported `Incompatible`.
   
   With `spark.comet.expr.allowIncompatible=true` that cast then ran natively, 
even though one child has no native path. `Unsupported` in any child should win 
over `Incompatible`, independent of child order.
   
   ## What changes are included in this PR?
   
   - Add `combineSupportLevels` with precedence `Unsupported` > `Incompatible` 
> `Compatible`.
   - Use it for struct → struct, struct → string, and map key/value support. 
Array paths are unchanged; they have a single child.
   - Leave fallback and error behavior unchanged outside nested support 
classification.
   
   ## How are these changes tested?
   
   - `./mvnw test -Dtest=none -Dsuites="org.apache.comet.CometNativeCastSuite 
prefers Unsupported over Incompatible"`
     - 3 tests passed.
   - Added direct `CometCast.isSupported` cases where one child is 
`Incompatible` (negative-scale decimal → string) and another is `Unsupported`, 
in both orders, for struct → struct, struct → string, and map key/value.


-- 
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]

Reply via email to