andygrove opened a new pull request, #4677:
URL: https://github.com/apache/datafusion-comet/pull/4677

   ## Which issue does this PR close?
   
   Part of #4673.
   
   ## Rationale for this change
   
   The serde framework intends that an expression declares whether it can be 
accelerated through `getSupportLevel`, with the central dispatcher in 
`QueryPlanSerde` translating `Incompatible`/`Unsupported` into the appropriate 
fallback. Several array serdes instead made these decisions inside `convert` by 
calling `withFallbackReason` directly, even though the decisions are statically 
determinable from the expression.
   
   ## What changes are included in this PR?
   
   Move static support decisions out of `convert` and into `getSupportLevel` 
for the array expressions:
   
   - `ArrayRemove`, `Flatten`, `ArrayPosition`: unsupported input data types, 
via a shared `ArraysBase.childTypesSupportLevel` helper.
   - `ArrayPosition`: all-foldable arguments fall back so Spark's 
`ConstantFolding` can handle them.
   - `SortArray`: `ascendingOrder` must be a boolean literal (folded into the 
existing `getSupportLevel`).
   - `ElementAt`: the input must be an array (`Map` inputs fall back).
   
   This is behavior-preserving: every case that previously fell back to Spark 
continues to fall back with the same reason. The remaining `withFallbackReason` 
calls in this file are child-reason rollups, which are the intended use inside 
`convert`.
   
   `ArrayExcept` and `ArrayReverse` are intentionally left for a follow-up. 
Their `isTypeSupported` checks interact with the codegen-dispatch routing used 
for `Incompatible` expressions (a binary-array `reverse`, for example, stays 
native via the codegen dispatcher), so reclassifying those checks as 
`Unsupported` would change routing and is not behavior-preserving in isolation.
   
   ## How are these changes tested?
   
   Covered by existing tests in `CometArrayExpressionSuite` (41 tests), which 
exercise both the supported and fallback paths for these expressions.
   


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