drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mehant Baid (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-2411) Scalar SUM/AVG over empty result set returns no rows instead of NULL
Date Tue, 10 Mar 2015 00:34:39 GMT

    [ https://issues.apache.org/jira/browse/DRILL-2411?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14353974#comment-14353974
] 

Mehant Baid commented on DRILL-2411:
------------------------------------

Yes it is a different function, however the base problem seems to be a bug in streaming agg
where we cannot handle the case where all input is null. We can keep this open and make sure
this symptom also works once DRILL-2277 is resolved.

> Scalar SUM/AVG over empty result set returns no rows instead of NULL
> --------------------------------------------------------------------
>
>                 Key: DRILL-2411
>                 URL: https://issues.apache.org/jira/browse/DRILL-2411
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Relational Operators
>            Reporter: Victoria Markman
>            Assignee: Steven Phillips
>
> Queries below should return NULL:
> {code}
> 0: jdbc:drill:schema=dfs> select sum(a2) from t2 where 1=0;
> +------------+
> |   EXPR$0   |
> +------------+
> +------------+
> No rows selected (0.08 seconds)
> 0: jdbc:drill:schema=dfs> select avg(a2) from t2 where 1=0;
> +------------+
> |   EXPR$0   |
> +------------+
> +------------+
> No rows selected (0.074 seconds)
> {code}
> When grouped, result is correct:
> {code}
> 0: jdbc:drill:schema=dfs> select a2, sum(a2) from t2 where 1=0 group by a2;
> +------------+------------+
> |     a2     |   EXPR$1   |
> +------------+------------+
> +------------+------------+
> No rows selected (0.11 seconds)
> {code}
> I'm not convinced and it is not very intuitive that correct result should be NULL, but
this is what postgres returns and Aman thinks NULL is the correct behavior :)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message