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

   ## Which issue does this PR close?
   
   Closes #.
   
   ## Rationale for this change
   
   `greatest` and `least` are commonly used Spark math expressions that were 
previously falling back to Spark execution. DataFusion's built-in 
implementations have matching semantics (NULL-skipping, NaN total ordering), so 
we can delegate directly without custom Rust code.
   
   ## What changes are included in this PR?
   
   - Register `Greatest` and `Least` in `QueryPlanSerde.mathExpressions` using 
`CometScalarFunction`, which delegates to DataFusion's built-in 
`greatest`/`least` UDFs
   - Add comprehensive SQL test files covering: int, bigint, float/double (NaN, 
Infinity), string, date, decimal, boolean, timestamp types, NULL handling, 
mixed column/literal arguments, and many-argument variadic calls
   - Mark both expressions as supported in `spark_expressions_support.md`
   
   The `implement-comet-expression` skill was used to scaffold the 
implementation.
   
   ## How are these changes tested?
   
   New Comet SQL Test files:
   - `spark/src/test/resources/sql-tests/expressions/math/greatest.sql`
   - `spark/src/test/resources/sql-tests/expressions/math/least.sql`
   
   Both run queries through Spark and Comet, comparing results and verifying 
native execution (no fallback). Tests cover all major data types and edge cases 
including NaN, Infinity, NULL propagation, and boundary values.


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