facebookincubator / velox

A composable and fully extensible C++ execution engine library for data management systems.
https://velox-lib.io/
Apache License 2.0
3.54k stars 1.16k forks source link

inverse_normal_cdf: Presto throws while Velox returns non-NULL #10836

Open kagamiori opened 3 months ago

kagamiori commented 3 months ago

Description

Query:

SELECT
    INVERSE_NORMAL_CDF(
        0.99995478457003,
        0.4660736045334488,
        INVERSE_BETA_CDF(
            0.99995478457003,
            ATAN2(0.3869894868694246, EXP(c0)),
            0.99995478457003
        )
    )
FROM (
    VALUES
        (0.11456725979223847)
) t(c0);

Presto-0.289: Throws an exception "inverseNormalCdf Function: p must be 0 > p > 1". Velox: Returns 4.435685217513072.

Error Reproduction

No response

Relevant logs

No response

Yuhta commented 3 months ago

INVERSE_BETA_CDF should always return a value in [0, 1]. Apparently a bug in Java (also WTF is 0 > p > 1?!!).