theirix opened a new pull request, #24419:
URL: https://github.com/apache/datafusion/pull/24419

   ## Which issue does this PR close?
   
   - Closes #22042.
   
   ## Rationale for this change
   
   UDF `percentile_cont` uses floating-point arithmetic to find a percentile, 
which doesn't work well for decimals. The `median` UDF already supports 
decimals. Let's implement decimals in `percentile_cont` and build `median` on 
top of it.
   
   A follow-up to #21988, refines #23954. 
   
   ## What changes are included in this PR?
   
   - Exact decimal support for `percentile_cont`, without float coercion
   - Integer support for `percentile_cont` (backported from `median` UDF)
   - Linear interpolation for both float (old code), decimal and integer code 
paths (new code)
   - Implement `median` on top of `percentile_cont` UDF by prepending a `0.5f` 
argument
   - Add SLTs to verify code
   - Make `percentile_cont(NULL)` return NULL (see changes below), under a new 
SLT test case
   
   ## Are these changes tested?
   
   - Extend SLTs
   - Unit test to verify integer inputs (cannot be done in SLT)
   - Unit tests for `percentile_cont`
   
   ## Are there any user-facing changes?
   
   - `percentile_cont(NULL)` now returns a NULL type instead of a Float64 type, 
aligning with other aggregate UDFs


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