You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Muhammad Gelbana (JIRA)" <ji...@apache.org> on 2019/07/01 13:36:00 UTC

[jira] [Created] (CALCITE-3164) Averaging an all-nulls values after grouping produce NaN instead of NULL

Muhammad Gelbana created CALCITE-3164:
-----------------------------------------

             Summary: Averaging an all-nulls values after grouping produce NaN instead of NULL
                 Key: CALCITE-3164
                 URL: https://issues.apache.org/jira/browse/CALCITE-3164
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.20.0
            Reporter: Muhammad Gelbana


{code:sql}
-- Values are a single tuple
SELECT C1, avg(C2)
FROM (VALUES('X', NULL::INT)) T (C1, C2)
GROUP  BY C1

-- Values are more than a single tuple
SELECT C1, avg(C2)
FROM (VALUES('X', NULL::INT), ('X', NULL::INT)) T (C1, C2)
GROUP  BY C1
{code}

Those queries return {{NaN}} while it's expected to return {{NULL}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)