[jira] [Updated] (PHOENIX-3491) OrderBy should be compiled out when GroupBy is not orderPreserving but OrderBy is reverse

2016-11-18 Thread chenglei (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenglei updated PHOENIX-3491:
--
Attachment: (was: PHOENIX-3491_v1.patch)

> OrderBy should be compiled out when GroupBy is not orderPreserving but 
> OrderBy is reverse
> -
>
> Key: PHOENIX-3491
> URL: https://issues.apache.org/jira/browse/PHOENIX-3491
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 4.8.0
>Reporter: chenglei
>Assignee: chenglei
> Attachments: PHOENIX-3491_v1.patch
>
>
> for the following table:
> {code:borderStyle=solid}
> CREATE TABLE ORDERBY_TEST ( 
> ORGANIZATION_ID INTEGER NOT NULL,
> CONTAINER_ID INTEGER NOT NULL,
> SCORE INTEGER NOT NULL,
> ENTITY_ID INTEGER NOT NULL, 
>CONSTRAINT TEST_PK PRIMARY KEY ( 
> ORGANIZATION_ID,
> CONTAINER_ID,
> SCORE,
> ENTITY_ID
> ));
>  {code}   
>   
> If we execute explain on the following sql: 
> {code:borderStyle=solid}   
> SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
> SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
> {code}
> the result is :
> {code:borderStyle=solid} 
> --+
> | PLAN |
> +--+
> | CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER ORDERBY_TEST|
> | SERVER FILTER BY FIRST KEY ONLY  |
> | SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
> | CLIENT MERGE SORT|
> | CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
> +--+
> {code} 
> from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
> DESC, SCORE DESC is not  compiled out,but obviously it should be compiled out 
>  as OrderBy.REV_ROW_KEY_ORDER_BY.



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


[jira] [Updated] (PHOENIX-3491) OrderBy should be compiled out when GroupBy is not orderPreserving but OrderBy is reverse

2016-11-18 Thread chenglei (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenglei updated PHOENIX-3491:
--
Attachment: PHOENIX-3491_v1.patch

> OrderBy should be compiled out when GroupBy is not orderPreserving but 
> OrderBy is reverse
> -
>
> Key: PHOENIX-3491
> URL: https://issues.apache.org/jira/browse/PHOENIX-3491
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 4.8.0
>Reporter: chenglei
>Assignee: chenglei
> Attachments: PHOENIX-3491_v1.patch
>
>
> for the following table:
> {code:borderStyle=solid}
> CREATE TABLE ORDERBY_TEST ( 
> ORGANIZATION_ID INTEGER NOT NULL,
> CONTAINER_ID INTEGER NOT NULL,
> SCORE INTEGER NOT NULL,
> ENTITY_ID INTEGER NOT NULL, 
>CONSTRAINT TEST_PK PRIMARY KEY ( 
> ORGANIZATION_ID,
> CONTAINER_ID,
> SCORE,
> ENTITY_ID
> ));
>  {code}   
>   
> If we execute explain on the following sql: 
> {code:borderStyle=solid}   
> SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
> SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
> {code}
> the result is :
> {code:borderStyle=solid} 
> --+
> | PLAN |
> +--+
> | CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER ORDERBY_TEST|
> | SERVER FILTER BY FIRST KEY ONLY  |
> | SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
> | CLIENT MERGE SORT|
> | CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
> +--+
> {code} 
> from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
> DESC, SCORE DESC is not  compiled out,but obviously it should be compiled out 
>  as OrderBy.REV_ROW_KEY_ORDER_BY.



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


[jira] [Updated] (PHOENIX-3491) OrderBy should be compiled out when GroupBy is not orderPreserving but OrderBy is reverse

2016-11-18 Thread chenglei (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenglei updated PHOENIX-3491:
--
Attachment: PHOENIX-3491_v1.patch

> OrderBy should be compiled out when GroupBy is not orderPreserving but 
> OrderBy is reverse
> -
>
> Key: PHOENIX-3491
> URL: https://issues.apache.org/jira/browse/PHOENIX-3491
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 4.8.0
>Reporter: chenglei
>Assignee: chenglei
> Attachments: PHOENIX-3491_v1.patch
>
>
> for the following table:
> {code:borderStyle=solid}
> CREATE TABLE ORDERBY_TEST ( 
> ORGANIZATION_ID INTEGER NOT NULL,
> CONTAINER_ID INTEGER NOT NULL,
> SCORE INTEGER NOT NULL,
> ENTITY_ID INTEGER NOT NULL, 
>CONSTRAINT TEST_PK PRIMARY KEY ( 
> ORGANIZATION_ID,
> CONTAINER_ID,
> SCORE,
> ENTITY_ID
> ));
>  {code}   
>   
> If we execute explain on the following sql: 
> {code:borderStyle=solid}   
> SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
> SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
> {code}
> the result is :
> {code:borderStyle=solid} 
> --+
> | PLAN |
> +--+
> | CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER ORDERBY_TEST|
> | SERVER FILTER BY FIRST KEY ONLY  |
> | SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
> | CLIENT MERGE SORT|
> | CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
> +--+
> {code} 
> from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
> DESC, SCORE DESC is not  compiled out,but obviously it should be compiled out 
>  as OrderBy.REV_ROW_KEY_ORDER_BY.



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


[jira] [Updated] (PHOENIX-3491) OrderBy should be compiled out when GroupBy is not orderPreserving but OrderBy is reverse

2016-11-16 Thread chenglei (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenglei updated PHOENIX-3491:
--
Description: 
for the following table:
{code:borderStyle=solid}
CREATE TABLE ORDERBY_TEST ( 
ORGANIZATION_ID INTEGER NOT NULL,
CONTAINER_ID INTEGER NOT NULL,
SCORE INTEGER NOT NULL,
ENTITY_ID INTEGER NOT NULL, 
   CONSTRAINT TEST_PK PRIMARY KEY ( 
ORGANIZATION_ID,
CONTAINER_ID,
SCORE,
ENTITY_ID
));
 {code}   
  
If we execute explain on the following sql: 
{code:borderStyle=solid}   
SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
{code}

the result is :
{code:borderStyle=solid} 
--+
| PLAN |
+--+
| CLIENT 1-CHUNK PARALLEL 1-WAY FULL SCAN OVER ORDERBY_TEST|
| SERVER FILTER BY FIRST KEY ONLY  |
| SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
| CLIENT MERGE SORT|
| CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
+--+
{code} 

from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
DESC, SCORE DESC is not  compiled out,but obviously it should be compiled out  
as OrderBy.REV_ROW_KEY_ORDER_BY.

  was:
for the following table:
{code:borderStyle=solid}
CREATE TABLE ORDERBY_TEST ( 
ORGANIZATION_ID INTEGER NOT NULL,
CONTAINER_ID INTEGER NOT NULL,
SCORE INTEGER NOT NULL,
ENTITY_ID INTEGER NOT NULL, 
   CONSTRAINT TEST_PK PRIMARY KEY ( 
ORGANIZATION_ID,
CONTAINER_ID,
SCORE,
ENTITY_ID
));
 {code}   
  
If we execute explain on the following sql: 
{code:borderStyle=solid}   
SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
{code}

the result is :
{code:borderStyle=solid} 
--+
| PLAN |
+--+
| CLIENT 2-CHUNK PARALLEL 2-WAY FULL SCAN OVER ORDERBY_TEST|
| SERVER FILTER BY FIRST KEY ONLY  |
| SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
| CLIENT MERGE SORT|
| CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
+--+
{code} 

from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
DESC, SCORE DESC is not  compiled out,but obviously it should be compiled out  
as OrderBy.REV_ROW_KEY_ORDER_BY.


> OrderBy should be compiled out when GroupBy is not orderPreserving but 
> OrderBy is reverse
> -
>
> Key: PHOENIX-3491
> URL: https://issues.apache.org/jira/browse/PHOENIX-3491
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 4.8.0
>Reporter: chenglei
>
> for the following table:
> {code:borderStyle=solid}
> CREATE TABLE ORDERBY_TEST ( 
> ORGANIZATION_ID INTEGER NOT NULL,
> CONTAINER_ID INTEGER NOT NULL,
> SCORE INTEGER NOT NULL,
> ENTITY_ID INTEGER NOT NULL, 
>CONSTRAINT TEST_PK PRIMARY KEY ( 
> ORGANIZATION_ID,
> CONTAINER_ID,
> SCORE,
> ENTITY_ID
> ));
>  {code}   
>   
> If we execute explain on the following sql: 
> {code:borderStyle=solid}   
> SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
> SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
> {code}
> the result is :
> {code:borderStyle=solid} 
> --+
> | PLAN |
> 

[jira] [Updated] (PHOENIX-3491) OrderBy should be compiled out when GroupBy is not orderPreserving but OrderBy is reverse

2016-11-16 Thread chenglei (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenglei updated PHOENIX-3491:
--
Summary: OrderBy should be compiled out when GroupBy is not orderPreserving 
but OrderBy is reverse  (was: OrderBy should be compiled out when GroupBy is 
not OrderPreserving but OrderBy is reverse)

> OrderBy should be compiled out when GroupBy is not orderPreserving but 
> OrderBy is reverse
> -
>
> Key: PHOENIX-3491
> URL: https://issues.apache.org/jira/browse/PHOENIX-3491
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 4.8.0
>Reporter: chenglei
>
> for the following table:
> {code:borderStyle=solid}
> CREATE TABLE ORDERBY_TEST ( 
> ORGANIZATION_ID INTEGER NOT NULL,
> CONTAINER_ID INTEGER NOT NULL,
> SCORE INTEGER NOT NULL,
> ENTITY_ID INTEGER NOT NULL, 
>CONSTRAINT TEST_PK PRIMARY KEY ( 
> ORGANIZATION_ID,
> CONTAINER_ID,
> SCORE,
> ENTITY_ID
> ));
>  {code}   
>   
> If we execute explain on the following sql: 
> {code:borderStyle=solid}   
> SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
> SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
> {code}
> the result is :
> {code:borderStyle=solid} 
> --+
> | PLAN |
> +--+
> | CLIENT 2-CHUNK PARALLEL 2-WAY FULL SCAN OVER ORDERBY_TEST|
> | SERVER FILTER BY FIRST KEY ONLY  |
> | SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
> | CLIENT MERGE SORT|
> | CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
> +--+
> {code} 
> from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
> DESC, SCORE DESC is not  compiled out,but obvious it should be compiled out  
> as OrderBy.REV_ROW_KEY_ORDER_BY.



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


[jira] [Updated] (PHOENIX-3491) OrderBy should be compiled out when GroupBy is not orderPreserving but OrderBy is reverse

2016-11-16 Thread chenglei (JIRA)

 [ 
https://issues.apache.org/jira/browse/PHOENIX-3491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

chenglei updated PHOENIX-3491:
--
Description: 
for the following table:
{code:borderStyle=solid}
CREATE TABLE ORDERBY_TEST ( 
ORGANIZATION_ID INTEGER NOT NULL,
CONTAINER_ID INTEGER NOT NULL,
SCORE INTEGER NOT NULL,
ENTITY_ID INTEGER NOT NULL, 
   CONSTRAINT TEST_PK PRIMARY KEY ( 
ORGANIZATION_ID,
CONTAINER_ID,
SCORE,
ENTITY_ID
));
 {code}   
  
If we execute explain on the following sql: 
{code:borderStyle=solid}   
SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
{code}

the result is :
{code:borderStyle=solid} 
--+
| PLAN |
+--+
| CLIENT 2-CHUNK PARALLEL 2-WAY FULL SCAN OVER ORDERBY_TEST|
| SERVER FILTER BY FIRST KEY ONLY  |
| SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
| CLIENT MERGE SORT|
| CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
+--+
{code} 

from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
DESC, SCORE DESC is not  compiled out,but obviously it should be compiled out  
as OrderBy.REV_ROW_KEY_ORDER_BY.

  was:
for the following table:
{code:borderStyle=solid}
CREATE TABLE ORDERBY_TEST ( 
ORGANIZATION_ID INTEGER NOT NULL,
CONTAINER_ID INTEGER NOT NULL,
SCORE INTEGER NOT NULL,
ENTITY_ID INTEGER NOT NULL, 
   CONSTRAINT TEST_PK PRIMARY KEY ( 
ORGANIZATION_ID,
CONTAINER_ID,
SCORE,
ENTITY_ID
));
 {code}   
  
If we execute explain on the following sql: 
{code:borderStyle=solid}   
SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
{code}

the result is :
{code:borderStyle=solid} 
--+
| PLAN |
+--+
| CLIENT 2-CHUNK PARALLEL 2-WAY FULL SCAN OVER ORDERBY_TEST|
| SERVER FILTER BY FIRST KEY ONLY  |
| SERVER AGGREGATE INTO DISTINCT ROWS BY [ORGANIZATION_ID, SCORE]  |
| CLIENT MERGE SORT|
| CLIENT SORTED BY [ORGANIZATION_ID DESC, SCORE DESC]  |
+--+
{code} 

from the above explain result, we can see that the ORDER BY ORGANIZATION_ID 
DESC, SCORE DESC is not  compiled out,but obvious it should be compiled out  as 
OrderBy.REV_ROW_KEY_ORDER_BY.


> OrderBy should be compiled out when GroupBy is not orderPreserving but 
> OrderBy is reverse
> -
>
> Key: PHOENIX-3491
> URL: https://issues.apache.org/jira/browse/PHOENIX-3491
> Project: Phoenix
>  Issue Type: Improvement
>Affects Versions: 4.8.0
>Reporter: chenglei
>
> for the following table:
> {code:borderStyle=solid}
> CREATE TABLE ORDERBY_TEST ( 
> ORGANIZATION_ID INTEGER NOT NULL,
> CONTAINER_ID INTEGER NOT NULL,
> SCORE INTEGER NOT NULL,
> ENTITY_ID INTEGER NOT NULL, 
>CONSTRAINT TEST_PK PRIMARY KEY ( 
> ORGANIZATION_ID,
> CONTAINER_ID,
> SCORE,
> ENTITY_ID
> ));
>  {code}   
>   
> If we execute explain on the following sql: 
> {code:borderStyle=solid}   
> SELECT ORGANIZATION_ID,SCORE FROM ORDERBY_TEST  GROUP BY ORGANIZATION_ID, 
> SCORE ORDER BY ORGANIZATION_ID DESC, SCORE DESC 
> {code}
> the result is :
> {code:borderStyle=solid} 
> --+
> | PLAN |
>