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

James Taylor commented on PHOENIX-2053:
---------------------------------------

Looks fine to me in 4.4.0 release:
{code}
0: jdbc:phoenix:localhost> create table test(a integer not null,b integer not 
null, c integer not null , d integer constraint pk primary key (a,b,c) ) 
TTL=86400 split on (2,3,4,5,6,7,8,9,10);
No rows affected (5.493 seconds)
0: jdbc:phoenix:localhost> upsert into test values (1,-1,1,1) ;
1 row affected (0.05 seconds)
0: jdbc:phoenix:localhost> upsert into test values (2,-2,2,1) ;
1 row affected (0.006 seconds)
0: jdbc:phoenix:localhost> upsert into test values (3,-3,3,1) ;
1 row affected (0.005 seconds)
0: jdbc:phoenix:localhost> upsert into test values (4,-4,4,1) ;
1 row affected (0.005 seconds)
0: jdbc:phoenix:localhost> upsert into test values (5,-5,5,1) ;
1 row affected (0.006 seconds)
0: jdbc:phoenix:localhost> upsert into test values (6,-6,6,1) ;
1 row affected (0.005 seconds)
0: jdbc:phoenix:localhost> 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)            
      |
+------------------------------------------+------------------------------------------+
| 1                                        | 1                                  
      |
| 2                                        | 1                                  
      |
| 4                                        | 1                                  
      |
| 5                                        | 1                                  
      |
+------------------------------------------+------------------------------------------+
4 rows selected (0.07 seconds)
0: jdbc:phoenix:localhost> 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                                  
      |
+------------------------------------------+------------------------------------------+
4 rows selected (0.044 seconds)
{code}

> 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)

Reply via email to