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/21 06:35:39 UTC
[jira] [Resolved] (PHOENIX-2617) query result not correct when pk
is constraint and inlist condition in second position.
[ https://issues.apache.org/jira/browse/PHOENIX-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
James Taylor resolved PHOENIX-2617.
-----------------------------------
Resolution: Duplicate
Assignee: James Taylor
Already fixed in PHOENIX-2559. I verified it with the latest:
{code}
0: jdbc:phoenix:localhost> CREATE TABLE bugTable ( name varchar, address varchar,company varchar, interest varchar CONSTRAINT pk PRIMARY KEY (name,address,company) );
No rows affected (1.401 seconds)
0: jdbc:phoenix:localhost> upsert into bugTable values ('A1','B1','C1','D1');
1 row affected (0.049 seconds)
0: jdbc:phoenix:localhost> upsert into bugTable (name,company,interest) values ('A2','C2','D2');
1 row affected (0.005 seconds)
0: jdbc:phoenix:localhost> upsert into bugTable values ('A3','B3','C3','D3');
1 row affected (0.004 seconds)
0: jdbc:phoenix:localhost> select * from bugTable where address in('B1','B3') and interest='D2';
+-------+----------+----------+-----------+
| NAME | ADDRESS | COMPANY | INTEREST |
+-------+----------+----------+-----------+
+-------+----------+----------+-----------+
No rows selected (0.062 seconds)
0: jdbc:phoenix:localhost> select * from bugTable;
+-------+----------+----------+-----------+
| NAME | ADDRESS | COMPANY | INTEREST |
+-------+----------+----------+-----------+
| A1 | B1 | C1 | D1 |
| A2 | | C2 | D2 |
| A3 | B3 | C3 | D3 |
+-------+----------+----------+-----------+
{code}
> query result not correct when pk is constraint and inlist condition in second position.
> ---------------------------------------------------------------------------------------
>
> Key: PHOENIX-2617
> URL: https://issues.apache.org/jira/browse/PHOENIX-2617
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 3.1.0
> Environment: CentOS
> Reporter: ChenFangRong
> Assignee: James Taylor
> Labels: easyfix
>
> create Table sql,
> CREATE TABLE bugTable ( name varchar, address varchar,company varchar, interest varchar CONSTRAINT pk PRIMARY KEY (name,address,company) );
> upsert the value,the table and its value is now as below:
> upsert value sql,
> upsert into bugTable values ('A1','B1','C1','D1');
> upsert into bugTable (name,company,interest) values ('A2','C2','D2');
> upsert into bugTable values ('A3','B3','C3','D3');
> name address company interest
> A1 B1 C1 D1
> A2 null C2 D2
> A3 B3 C3 D3
> if you use the sql to query:
> select * from bugTable where address in('B1','B3') and interest='D2';
> the query result is :
> name address company interest
> A2 null C2 D2
> the result is supposed to be null.
> but the fact is it has a result,phoenix does not filter the column where the value of address is null.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)