The approxQuantile() method returns sometimes incorrect results that are sensitively dependent upon the choice of the relativeError.
Below is an example in the latest Spark version (2.4.4). You can see the result varies significantly for modest changes in the specified relativeError parameter. The result varies much more than would be expected based upon the relativeError parameter.
I attached a zip file containing the data used for the above example demonstrating the bug.
Also, the following demonstrates that there is data for intermediate quantile values between the 0.5926195654486178 and 0.67621027121925 values observed above.