[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-21 Thread Hudson (JIRA)

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

Hudson commented on PHOENIX-3342:
-

FAILURE: Integrated in Jenkins build Phoenix-master #1447 (See 
[https://builds.apache.org/job/Phoenix-master/1447/])
PHOENIX-3342 ORDER BY and LIMIT+OFFSET doesnt work on second column from 
(ankitsinghal59: rev 8f5c8cfbd1c1f7894e4cc88e2257d245d1d8c3bf)
* (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java
* (edit) 
phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
* (edit) 
phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
* (edit) 
phoenix-core/src/test/java/org/apache/phoenix/compile/StatementHintsCompilationTest.java
* (edit) phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java
* (edit) phoenix-core/src/main/java/org/apache/phoenix/execute/UnionPlan.java
* (edit) phoenix-core/src/test/java/org/apache/phoenix/query/QueryPlanTest.java
* (edit) 
phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortTopNResultIterator.java


> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
>Assignee: Ankit Singhal
> Fix For: 4.9.0, 4.8.2
>
> Attachments: PHOENIX-3342-wip.patch, PHOENIX-3342.patch, 
> PHOENIX-3342_v1.patch, PHOENIX-3342_v2.patch, PHOENIX-3342_v2_4.8_branch.patch
>
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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


[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-21 Thread Hudson (JIRA)

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

Hudson commented on PHOENIX-3342:
-

SUCCESS: Integrated in Jenkins build Phoenix-4.8-HBase-1.2 #39 (See 
[https://builds.apache.org/job/Phoenix-4.8-HBase-1.2/39/])
PHOENIX-3342 ORDER BY and LIMIT+OFFSET doesnt work on second column from 
(ankitsinghal59: rev b2f0c48c2ff4c425b6b192d85f218e966284152e)
* (edit) phoenix-core/src/main/java/org/apache/phoenix/execute/UnionPlan.java
* (edit) 
phoenix-core/src/test/java/org/apache/phoenix/compile/StatementHintsCompilationTest.java
* (edit) 
phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java
* (edit) phoenix-core/src/main/java/org/apache/phoenix/execute/ScanPlan.java
* (edit) 
phoenix-core/src/it/java/org/apache/phoenix/end2end/QueryWithOffsetIT.java
* (edit) phoenix-core/src/test/java/org/apache/phoenix/query/QueryPlanTest.java
* (edit) phoenix-core/src/it/java/org/apache/phoenix/end2end/UnionAllIT.java
* (edit) 
phoenix-core/src/main/java/org/apache/phoenix/iterate/MergeSortTopNResultIterator.java


> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
>Assignee: Ankit Singhal
> Fix For: 4.9.0, 4.8.2
>
> Attachments: PHOENIX-3342-wip.patch, PHOENIX-3342.patch, 
> PHOENIX-3342_v1.patch, PHOENIX-3342_v2.patch, PHOENIX-3342_v2_4.8_branch.patch
>
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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


[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-20 Thread Sergey Soldatov (JIRA)

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

Sergey Soldatov commented on PHOENIX-3342:
--

[~an...@apache.org] I haven't had a chance to build with you patch, so just 
wonder whether explain will show the correct number of rows for TopN for the 
test case in description (it's supposed to be 3) .
Also you brought REBUILD_INDEXES constant in the patch. Looks like a part of 
another fix.

> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
> Fix For: 4.9.0, 4.8.2
>
> Attachments: PHOENIX-3342-wip.patch, PHOENIX-3342.patch, 
> PHOENIX-3342_v1.patch
>
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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


[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-20 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on PHOENIX-3342:


{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12834378/PHOENIX-3342_v1.patch
  against master branch at commit 1e78d3b368b7aa8397224074f691ea2fed340e34.
  ATTACHMENT ID: 12834378

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:green}+1 tests included{color}.  The patch appears to include 6 new 
or modified tests.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:red}-1 javadoc{color}.  The javadoc tool appears to have generated 
43 warning messages.

{color:red}-1 release audit{color}.  The applied patch generated 1 release 
audit warnings (more than the master's current 0 warnings).

{color:red}-1 lineLengths{color}.  The patch introduces the following lines 
longer than 100:
+.executeQuery("SELECT k2 from " + tableName + " order by 
k2 desc limit " + limit + " offset " + offset);
+limit == null ? -1 : QueryUtil.getOffsetLimit(limit, 
offset), orderBy.getOrderByExpressions(),
+Integer perScanLimit = !allowPageFilter || isOrdered ? null : 
QueryUtil.getOffsetLimit(limit, offset);
+plan.getStatement().getHint(), 
QueryUtil.getOffsetLimit(plan.getLimit(), plan.getOffset()), offset);

 {color:red}-1 core tests{color}.  The patch failed these unit tests:
 
./phoenix-core/target/failsafe-reports/TEST-org.apache.phoenix.end2end.UnionAllIT

Test results: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/629//testReport/
Release audit warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/629//artifact/patchprocess/patchReleaseAuditWarnings.txt
Javadoc warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/629//artifact/patchprocess/patchJavadocWarnings.txt
Console output: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/629//console

This message is automatically generated.

> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
> Fix For: 4.9.0, 4.8.2
>
> Attachments: PHOENIX-3342-wip.patch, PHOENIX-3342.patch, 
> PHOENIX-3342_v1.patch
>
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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


[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-20 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on PHOENIX-3342:


{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  http://issues.apache.org/jira/secure/attachment/12834373/PHOENIX-3342.patch
  against master branch at commit 1e78d3b368b7aa8397224074f691ea2fed340e34.
  ATTACHMENT ID: 12834373

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:red}-1 tests included{color}.  The patch doesn't appear to include 
any new or modified tests.
Please justify why no new tests are needed for this 
patch.
Also please list what manual steps were performed to 
verify this patch.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:red}-1 javadoc{color}.  The javadoc tool appears to have generated 
43 warning messages.

{color:red}-1 release audit{color}.  The applied patch generated 1 release 
audit warnings (more than the master's current 0 warnings).

{color:red}-1 lineLengths{color}.  The patch introduces the following lines 
longer than 100:
+.executeQuery("SELECT k2 from " + tableName + " order by 
k2 desc limit " + limit + " offset " + offset);
+limit == null ? -1 : QueryUtil.getOffsetLimit(limit, 
offset), orderBy.getOrderByExpressions(),
+Integer perScanLimit = !allowPageFilter || isOrdered ? null : 
QueryUtil.getOffsetLimit(limit, offset);
+plan.getStatement().getHint(), 
QueryUtil.getOffsetLimit(plan.getLimit(), plan.getOffset()), offset);

 {color:red}-1 core tests{color}.  The patch failed these unit tests:
   org.apache.phoenix.query.QueryPlanTest
  org.apache.phoenix.compile.StatementHintsCompilationTest

Test results: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/628//testReport/
Release audit warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/628//artifact/patchprocess/patchReleaseAuditWarnings.txt
Javadoc warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/628//artifact/patchprocess/patchJavadocWarnings.txt
Console output: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/628//console

This message is automatically generated.

> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
> Fix For: 4.9.0, 4.8.2
>
> Attachments: PHOENIX-3342-wip.patch, PHOENIX-3342.patch
>
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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


[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-20 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on PHOENIX-3342:


{color:red}-1 overall{color}.  Here are the results of testing the latest 
attachment 
  
http://issues.apache.org/jira/secure/attachment/12834344/PHOENIX-3342-wip.patch
  against master branch at commit 1e78d3b368b7aa8397224074f691ea2fed340e34.
  ATTACHMENT ID: 12834344

{color:green}+1 @author{color}.  The patch does not contain any @author 
tags.

{color:red}-1 tests included{color}.  The patch doesn't appear to include 
any new or modified tests.
Please justify why no new tests are needed for this 
patch.
Also please list what manual steps were performed to 
verify this patch.

{color:green}+1 javac{color}.  The applied patch does not increase the 
total number of javac compiler warnings.

{color:red}-1 javadoc{color}.  The javadoc tool appears to have generated 
43 warning messages.

{color:red}-1 release audit{color}.  The applied patch generated 1 release 
audit warnings (more than the master's current 0 warnings).

{color:red}-1 lineLengths{color}.  The patch introduces the following lines 
longer than 100:
+this.isDataToScanWithinThreshold = 
isAmountOfDataToScanWithinThreshold(context, table.getTable(), perScanLimit);
+ScanRegionObserver.serializeIntoScan(context.getScan(), 
thresholdBytes, perScanLimit == null
+planSteps.add("SERVER" + (limit == null ? "" : " TOP " + 
fullLimit + " ROW" + (fullLimit

 {color:red}-1 core tests{color}.  The patch failed these unit tests:
 ./phoenix-core/target/failsafe-reports/TEST-[2]

Test results: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/626//testReport/
Release audit warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/626//artifact/patchprocess/patchReleaseAuditWarnings.txt
Javadoc warnings: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/626//artifact/patchprocess/patchJavadocWarnings.txt
Console output: 
https://builds.apache.org/job/PreCommit-PHOENIX-Build/626//console

This message is automatically generated.

> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
> Fix For: 4.9.0, 4.8.2
>
> Attachments: PHOENIX-3342-wip.patch
>
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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


[jira] [Commented] (PHOENIX-3342) ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key

2016-10-07 Thread James Taylor (JIRA)

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

James Taylor commented on PHOENIX-3342:
---

[~an...@apache.org]?

> ORDER BY and LIMIT+OFFSET doesnt work on second column from compound key
> 
>
> Key: PHOENIX-3342
> URL: https://issues.apache.org/jira/browse/PHOENIX-3342
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.8.1
>Reporter: Alex Batyrshin
>
> Here is simple test case
> {code}
> CREATE TABLE "test" (
> col1 VARCHAR,
> col2 VARCHAR,
> "foo"."data" VARCHAR,
> CONSTRAINT PK PRIMARY KEY (col1, col2)
> );
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '1', 'd1');
> 1 row affected (0.044 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '2', 'd2');
> 1 row affected (0.008 seconds)
> 0: jdbc:phoenix:localhost> upsert into "test" (COL1, COL2, "data") values 
> ('1', '3', 'd3');
> 1 row affected (0.007 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 3 rows selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 1 | d1|
> +---+---+---+
> 1 row selected (0.026 seconds)
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 offset 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> | 1 | 2 | d2|
> | 1 | 3 | d3|
> +---+---+---+
> 2 rows selected (0.02 seconds)
> {code}
> And this query doesn't work as expected:
> {code}
> 0: jdbc:phoenix:localhost> select * from "test" order by col2 limit 1 offset 
> 1;
> +---+---+---+
> | COL1  | COL2  | data  |
> +---+---+---+
> +---+---+---+
> No rows selected (0.024 seconds)
> {code}



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