[jira] [Commented] (PHOENIX-3014) SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables

2016-06-21 Thread Hudson (JIRA)

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

Hudson commented on PHOENIX-3014:
-

FAILURE: Integrated in Phoenix-master #1282 (See 
[https://builds.apache.org/job/Phoenix-master/1282/])
PHOENIX-3014 SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results 
(larsh: rev cd3868ce418ded3391be45f89c7c428afd6f520e)
* 
phoenix-core/src/it/java/org/apache/phoenix/end2end/DistinctPrefixFilterIT.java
* phoenix-core/src/main/java/org/apache/phoenix/execute/AggregatePlan.java


> SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables
> --
>
> Key: PHOENIX-3014
> URL: https://issues.apache.org/jira/browse/PHOENIX-3014
> Project: Phoenix
>  Issue Type: Bug
>Reporter: Lars Hofhansl
>Assignee: James Taylor
> Fix For: 4.8.0
>
> Attachments: 3014-v2.txt, PHOENIX-3014_untested.patch
>
>
> {code}
> create table T(pk1 varchar not null, pk2 varchar not null, constraint pk 
> primary key(pk1, pk2)) SALT_BUCKETS=8;
> upsert into T values('1','1');
> upsert into T values('1','2');
> upsert into T values('2','1');
> select /*+ RANGE_SCAN */ distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> select distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> +--+
> {code}



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


[jira] [Commented] (PHOENIX-3014) SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables

2016-06-21 Thread Samarth Jain (JIRA)

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

Samarth Jain commented on PHOENIX-3014:
---

+1

> SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables
> --
>
> Key: PHOENIX-3014
> URL: https://issues.apache.org/jira/browse/PHOENIX-3014
> Project: Phoenix
>  Issue Type: Bug
>Reporter: Lars Hofhansl
> Fix For: 4.8.0
>
> Attachments: 3014-v2.txt, PHOENIX-3014_untested.patch
>
>
> {code}
> create table T(pk1 varchar not null, pk2 varchar not null, constraint pk 
> primary key(pk1, pk2)) SALT_BUCKETS=8;
> upsert into T values('1','1');
> upsert into T values('1','2');
> upsert into T values('2','1');
> select /*+ RANGE_SCAN */ distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> select distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> +--+
> {code}



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


[jira] [Commented] (PHOENIX-3014) SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables

2016-06-21 Thread Lars Hofhansl (JIRA)

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

Lars Hofhansl commented on PHOENIX-3014:


tests run with {{mvn package}} pass with this and PHOENIX-3012 applied.

> SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables
> --
>
> Key: PHOENIX-3014
> URL: https://issues.apache.org/jira/browse/PHOENIX-3014
> Project: Phoenix
>  Issue Type: Bug
>Reporter: Lars Hofhansl
> Fix For: 4.8.0
>
> Attachments: 3014-v2.txt, PHOENIX-3014_untested.patch
>
>
> {code}
> create table T(pk1 varchar not null, pk2 varchar not null, constraint pk 
> primary key(pk1, pk2)) SALT_BUCKETS=8;
> upsert into T values('1','1');
> upsert into T values('1','2');
> upsert into T values('2','1');
> select /*+ RANGE_SCAN */ distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> select distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> +--+
> {code}



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


[jira] [Commented] (PHOENIX-3014) SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables

2016-06-21 Thread Lars Hofhansl (JIRA)

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

Lars Hofhansl commented on PHOENIX-3014:


Actually removing this part from the patch makes things work:
{code}
this.getTableRef().getTable().getBucketNum() != null ? 
SaltingUtil.NUM_SALTING_BYTES : 0,
{code}


> SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables
> --
>
> Key: PHOENIX-3014
> URL: https://issues.apache.org/jira/browse/PHOENIX-3014
> Project: Phoenix
>  Issue Type: Bug
>Reporter: Lars Hofhansl
> Fix For: 4.8.0
>
> Attachments: PHOENIX-3014_untested.patch
>
>
> {code}
> create table T(pk1 varchar not null, pk2 varchar not null, constraint pk 
> primary key(pk1, pk2)) SALT_BUCKETS=8;
> upsert into T values('1','1');
> upsert into T values('1','2');
> upsert into T values('2','1');
> select /*+ RANGE_SCAN */ distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> select distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> +--+
> {code}



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


[jira] [Commented] (PHOENIX-3014) SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables

2016-06-21 Thread Lars Hofhansl (JIRA)

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

Lars Hofhansl commented on PHOENIX-3014:


[~samarthjain], this looks like a pretty important issue with incorrect results.

> SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables
> --
>
> Key: PHOENIX-3014
> URL: https://issues.apache.org/jira/browse/PHOENIX-3014
> Project: Phoenix
>  Issue Type: Bug
>Reporter: Lars Hofhansl
> Fix For: 4.8.0
>
> Attachments: PHOENIX-3014_untested.patch
>
>
> {code}
> create table T(pk1 varchar not null, pk2 varchar not null, constraint pk 
> primary key(pk1, pk2)) SALT_BUCKETS=8;
> upsert into T values('1','1');
> upsert into T values('1','2');
> upsert into T values('2','1');
> select /*+ RANGE_SCAN */ distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> select distinct(pk1) from T order by pk1 desc;
> +--+
> | PK1  |
> +--+
> | 1|
> | 2|
> | 1|
> +--+
> {code}



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