You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2016/01/24 20:32:39 UTC

[jira] [Commented] (PHOENIX-2279) Error result when there are both `group by` and `limit `operation after `union`

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

James Taylor commented on PHOENIX-2279:
---------------------------------------

Would you mind verifying this, [~maryannxue]? Maybe it's fixed now?

> Error result when there are both `group by` and `limit `operation after `union`
> -------------------------------------------------------------------------------
>
>                 Key: PHOENIX-2279
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2279
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 4.5.1
>            Reporter: Yi Tian
>            Assignee: Maryann Xue
>             Fix For: 4.8.0
>
>
> Here is how to reproduce this issue:
> {quote}
> 0: jdbc:phoenix:localhost> create table test2 (a varchar(10) CONSTRAINT PK PRIMARY KEY (a)) VERSIONS=1;
> No rows affected (0.259 seconds)
> 0: jdbc:phoenix:localhost> create table test1 (a varchar(10) CONSTRAINT PK PRIMARY KEY (a)) VERSIONS=1;
> No rows affected (0.258 seconds)
> 0: jdbc:phoenix:localhost> upsert into test2 values('a1');
> 1 row affected (0.014 seconds)
> 0: jdbc:phoenix:localhost> upsert into test2 values('a2');
> 1 row affected (0.004 seconds)
> 0: jdbc:phoenix:localhost> upsert into test1 values('a1');
> 1 row affected (0.013 seconds)
> 0: jdbc:phoenix:localhost> upsert into test1 values('a2');
> 1 row affected (0.005 seconds)
> 0: jdbc:phoenix:localhost> select a,count(1) from (select a from test1 union all select a from test2) group by a limit 2;
> +-------+----------+
> | A     | COUNT(1) |
> +-------+----------+
> | a1    | 2        |
> +-------+----------+
> 1 row selected (0.017 seconds)
> {quote}
> The result should be:
> +-------+----------+
> | A     | COUNT(1) |
> +-------+----------+
> | a1    | 2        |
> | a2    | 2        |
> +-------+----------+



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