davidlghellin commented on issue #18867: URL: https://github.com/apache/datafusion/issues/18867#issuecomment-3563457014
Hi again @alamb I couldn't find a built-in `median` function in PostgreSQL (I am definitely not a Postgres expert), but I did find the two official options: - `percentile_cont(0.5) WITHIN GROUP (ORDER BY x)` — continuous median with interpolation - `percentile_disc(0.5) WITHIN GROUP (ORDER BY x)` — discrete median So it seems that PostgreSQL does not define a standalone `median()` function, and relies on these two percentile variants instead. <img width="430" height="519" alt="Image" src="https://github.com/user-attachments/assets/8b9976f8-dbf6-4893-9554-80923b12c9c8" /> Let's close this issue for now. I’ll open a PR once the implementation is integrated on the Sail side, based on the ongoing work in the current PR. Thanks a lot for the guidance! -- 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]
