Saving the code snippet here in the hopes you don’t also spend multiple hours trying to figure this one out.
Luckily my use case didn’t require an exact median so using the ‘APPROX_QUANTILES’ function worked out just fine.
See below for the official documentation from Google: