You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Yi Tian (JIRA)" <ji...@apache.org> on 2015/09/21 16:37:04 UTC
[jira] [Created] (PHOENIX-2279) Error result when there are both
`group by` and `limit `operation after `union`
Yi Tian created PHOENIX-2279:
--------------------------------
Summary: 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
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)