phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Taylor (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (PHOENIX-2039) ROUND over numeric in GROUP BY always returns null
Date Tue, 05 Jan 2016 16:28:39 GMT

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

James Taylor edited comment on PHOENIX-2039 at 1/5/16 4:27 PM:
---------------------------------------------------------------

Yes, please push to 4.x branches as well, [~ram_krish].


was (Author: jamestaylor):
Yes, please push to 4.x branches as well.

> ROUND over numeric in GROUP BY always returns null
> --------------------------------------------------
>
>                 Key: PHOENIX-2039
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2039
>             Project: Phoenix
>          Issue Type: Bug
>            Reporter: James Taylor
>            Assignee: ramkrishna.s.vasudevan
>              Labels: newbie
>             Fix For: 4.7.0
>
>         Attachments: PHOENIX-2039.patch
>
>
> Here's an easy way to reproduce:
> {code}
> create table round_test(k bigint primary key);
> upsert into round_test values(1380603308885);
> select round(k/1000000,0) from round_test;
> +----------------------------------------+
> |             (K / 1000000)              |
> +----------------------------------------+
> | 1380603                                |
> +----------------------------------------+
> select round(k/1000000,0) x from round_test group by x;
> +----------------------------------------+
> |                   X                    |
> +----------------------------------------+
> | null                                   |
> +----------------------------------------+
> {code}
> Here's a work around:
> {code}
> select round(cast(k as date),'MINUTE',30) x from round_test group by x;
> +-------------------------+
> |            X            |
> +-------------------------+
> | 2013-10-01 05:00:00.000 |
> +-------------------------+
> select cast(round(cast(k as date),'MINUTE',30) as bigint) x 
> from round_test group by x;
> +------------------------------------------+
> |                    X                     |
> +------------------------------------------+
> | 1380603600000                            |
> +------------------------------------------+
> {code}



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

Mime
View raw message