[
https://issues.apache.org/jira/browse/PHOENIX-2053?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
PeiLiping updated PHOENIX-2053:
-------------------------------
Description:
drop table test;
create table test(a integer not null,b integer not null, c integer not null , d
integer constraint pk primary key (a,b,c) ) compression='SNAPPY' , TTL=86400
split on (2,3,4,5,6,7,8,9,10);
upsert into test values (1,-1,1,1) ;
upsert into test values (2,-2,2,1) ;
upsert into test values (3,-3,3,1) ;
upsert into test values (4,-4,4,1) ;
upsert into test values (5,-5,5,1) ;
upsert into test values (6,-6,6,1) ;
select c,sum(d) from test where a between 0 and 10 and b in (-2,-4,-5,-1) group
by c ;
+------------------------------------------+------------------------------------------+
| C | SUM(D)
|
+------------------------------------------+------------------------------------------+
| 5 | 1
|
+------------------------------------------+------------------------------------------+
select c,sum(d) from test where a between 0 and 10 and (0-b) in (2,4,5,1) group
by c ;
+------------------------------------------+------------------------------------------+
| C | SUM(D)
|
+------------------------------------------+------------------------------------------+
| 1 | 1
|
| 2 | 1
|
| 4 | 1
|
| 5 | 1
|
+------------------------------------------+------------------------------------------+
was:
select * from test where a in (1,2,3 ) is right
select * from test where a in (-1 ) is right
but select * from test where a in (-1,-2,-3) is wrong
I think when params are less then zero the scan range is wrong
> The Expression IN has Bug when the params are less than zero
> --------------------------------------------------------------
>
> Key: PHOENIX-2053
> URL: https://issues.apache.org/jira/browse/PHOENIX-2053
> Project: Phoenix
> Issue Type: Bug
> Affects Versions: 4.3.0
> Reporter: PeiLiping
>
> drop table test;
> create table test(a integer not null,b integer not null, c integer not null ,
> d integer constraint pk primary key (a,b,c) ) compression='SNAPPY' ,
> TTL=86400 split on (2,3,4,5,6,7,8,9,10);
> upsert into test values (1,-1,1,1) ;
> upsert into test values (2,-2,2,1) ;
> upsert into test values (3,-3,3,1) ;
> upsert into test values (4,-4,4,1) ;
> upsert into test values (5,-5,5,1) ;
> upsert into test values (6,-6,6,1) ;
> select c,sum(d) from test where a between 0 and 10 and b in (-2,-4,-5,-1)
> group by c ;
> +------------------------------------------+------------------------------------------+
> | C | SUM(D)
> |
> +------------------------------------------+------------------------------------------+
> | 5 | 1
> |
> +------------------------------------------+------------------------------------------+
> select c,sum(d) from test where a between 0 and 10 and (0-b) in (2,4,5,1)
> group by c ;
> +------------------------------------------+------------------------------------------+
> | C | SUM(D)
> |
> +------------------------------------------+------------------------------------------+
> | 1 | 1
> |
> | 2 | 1
> |
> | 4 | 1
> |
> | 5 | 1
> |
> +------------------------------------------+------------------------------------------+
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)