jayzhan211 commented on issue #10838:
URL: https://github.com/apache/datafusion/issues/10838#issuecomment-2156459652

   > Hi @jayzhan211 I tried to convert `ApproxPercentileCont`, but I 
encountered some challenges. `ApproxPercentileCont` creates the accumulator 
based on the `percentile` parameter, but I couldn't find a way to access this 
parameter when defining the UDAF. 
https://github.com/goldmedal/datafusion/blob/24a08465e12bc07275cafe5310a7ac44898e39de/datafusion/physical-expr/src/aggregate/approx_percentile_cont.rs#L104
   > 
   > The `AccumulatorArgs` doesn't carry the original argument expression, 
making it difficult to create the accumulator for `ApproxPercentileCont`. 
https://github.com/goldmedal/datafusion/blob/24a08465e12bc07275cafe5310a7ac44898e39de/datafusion/expr/src/function.rs#L45
   > 
   > I think we need another PR to address this issue. For now, I just moved 
`TDigest` and `ApproxPercentileAccumulator` in #10840 so that I can convert 
`approx_median` to a UDAF.
   
   We can add `self.args` to `AccumulatorArgs` and compute `percentile` and 
`tdigest max size` in `accumulator`.


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to