[jira] [Commented] (PHOENIX-2295) NullPointerException when parsing a query with hints in UNION ALL

2015-10-15 Thread Samarth Jain (JIRA)

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

Samarth Jain commented on PHOENIX-2295:
---

Pushed to 4.x and master branches. Thanks for the patch, Alicia. 

> NullPointerException when parsing a query with hints in UNION ALL
> -
>
> Key: PHOENIX-2295
> URL: https://issues.apache.org/jira/browse/PHOENIX-2295
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.4.0
> Environment: Linux, phoenix phoenix-4.4.0-HBase-1.1
>Reporter: Gasper Metelko
>Assignee: Alicia Ying Shu
> Fix For: 4.6.0
>
> Attachments: PHOENIX-2295-v1.patch, PHOENIX-2295.patch
>
>
> On the following db objects:
> CREATE TABLE table1 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE TABLE table2 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE INDEX INDEX_TABLE1_COL ON table1 (col1);
>  
> CREATE INDEX INDEX_TABLE2_COL ON table2 (col1);
> explain SELECT /*+ INDEX(table1 INDEX_TABLE1_COL) */ col1, col2 FROM table1 
> WHERE col1='123' UNION ALL SELECT /*+ INDEX(table2 INDEX_TABLE2_COL) */ col1, 
> col2 FROM table2 WHERE col1='123';
> On running the above statement there is a NPE:
> java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:559)
> at 
> org.apache.phoenix.iterate.UnionResultIterators.(UnionResultIterators.java:51)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:131)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:127)
> at 
> org.apache.phoenix.execute.UnionPlan.getExplainPlan(UnionPlan.java:150)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:424)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:403)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:246)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:241)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:240)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1250)
> at sqlline.Commands.execute(Commands.java:822)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)



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


[jira] [Commented] (PHOENIX-2295) NullPointerException when parsing a query with hints in UNION ALL

2015-10-15 Thread Samarth Jain (JIRA)

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

Samarth Jain commented on PHOENIX-2295:
---

+1, LGTM. I will get this committed.

> NullPointerException when parsing a query with hints in UNION ALL
> -
>
> Key: PHOENIX-2295
> URL: https://issues.apache.org/jira/browse/PHOENIX-2295
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.4.0
> Environment: Linux, phoenix phoenix-4.4.0-HBase-1.1
>Reporter: Gasper Metelko
>Assignee: Alicia Ying Shu
> Attachments: PHOENIX-2295-v1.patch, PHOENIX-2295.patch
>
>
> On the following db objects:
> CREATE TABLE table1 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE TABLE table2 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE INDEX INDEX_TABLE1_COL ON table1 (col1);
>  
> CREATE INDEX INDEX_TABLE2_COL ON table2 (col1);
> explain SELECT /*+ INDEX(table1 INDEX_TABLE1_COL) */ col1, col2 FROM table1 
> WHERE col1='123' UNION ALL SELECT /*+ INDEX(table2 INDEX_TABLE2_COL) */ col1, 
> col2 FROM table2 WHERE col1='123';
> On running the above statement there is a NPE:
> java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:559)
> at 
> org.apache.phoenix.iterate.UnionResultIterators.(UnionResultIterators.java:51)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:131)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:127)
> at 
> org.apache.phoenix.execute.UnionPlan.getExplainPlan(UnionPlan.java:150)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:424)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:403)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:246)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:241)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:240)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1250)
> at sqlline.Commands.execute(Commands.java:822)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)



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


[jira] [Commented] (PHOENIX-2295) NullPointerException when parsing a query with hints in UNION ALL

2015-10-07 Thread Alicia Ying Shu (JIRA)

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

Alicia Ying Shu commented on PHOENIX-2295:
--

[~samarthjain] For this particular case, there is no problem for AggregatePlan 
and UnionPlan. But it is good to check others. I modified the patch and checked 
additional more. Thanks for the review!

> NullPointerException when parsing a query with hints in UNION ALL
> -
>
> Key: PHOENIX-2295
> URL: https://issues.apache.org/jira/browse/PHOENIX-2295
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.4.0
> Environment: Linux, phoenix phoenix-4.4.0-HBase-1.1
>Reporter: Gasper Metelko
>Assignee: Alicia Ying Shu
> Attachments: PHOENIX-2295-v1.patch, PHOENIX-2295.patch
>
>
> On the following db objects:
> CREATE TABLE table1 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE TABLE table2 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE INDEX INDEX_TABLE1_COL ON table1 (col1);
>  
> CREATE INDEX INDEX_TABLE2_COL ON table2 (col1);
> explain SELECT /*+ INDEX(table1 INDEX_TABLE1_COL) */ col1, col2 FROM table1 
> WHERE col1='123' UNION ALL SELECT /*+ INDEX(table2 INDEX_TABLE2_COL) */ col1, 
> col2 FROM table2 WHERE col1='123';
> On running the above statement there is a NPE:
> java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:559)
> at 
> org.apache.phoenix.iterate.UnionResultIterators.(UnionResultIterators.java:51)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:131)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:127)
> at 
> org.apache.phoenix.execute.UnionPlan.getExplainPlan(UnionPlan.java:150)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:424)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:403)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:246)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:241)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:240)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1250)
> at sqlline.Commands.execute(Commands.java:822)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)



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


[jira] [Commented] (PHOENIX-2295) NullPointerException when parsing a query with hints in UNION ALL

2015-10-06 Thread Samarth Jain (JIRA)

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

Samarth Jain commented on PHOENIX-2295:
---

Patch looks good [~ayingshu]. A few suggestions:

1) Use Collections.emptyList() instead of Collections.EMPTY_LIST.
2) You would want to make the change of returning emptyList() for scans and 
splits in other implementors of QueryPlan too - UnionPlan and AggregatePlan.
3) I think the issue doesn't have to do only with hints per se. So 
testUnionAllSelectsWithHint could be misleading. Maybe just rename it to 
testBug2295() ? 

> NullPointerException when parsing a query with hints in UNION ALL
> -
>
> Key: PHOENIX-2295
> URL: https://issues.apache.org/jira/browse/PHOENIX-2295
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.4.0
> Environment: Linux, phoenix phoenix-4.4.0-HBase-1.1
>Reporter: Gasper Metelko
>Assignee: Alicia Ying Shu
> Attachments: PHOENIX-2295.patch
>
>
> On the following db objects:
> CREATE TABLE table1 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE TABLE table2 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE INDEX INDEX_TABLE1_COL ON table1 (col1);
>  
> CREATE INDEX INDEX_TABLE2_COL ON table2 (col1);
> explain SELECT /*+ INDEX(table1 INDEX_TABLE1_COL) */ col1, col2 FROM table1 
> WHERE col1='123' UNION ALL SELECT /*+ INDEX(table2 INDEX_TABLE2_COL) */ col1, 
> col2 FROM table2 WHERE col1='123';
> On running the above statement there is a NPE:
> java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:559)
> at 
> org.apache.phoenix.iterate.UnionResultIterators.(UnionResultIterators.java:51)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:131)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:127)
> at 
> org.apache.phoenix.execute.UnionPlan.getExplainPlan(UnionPlan.java:150)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:424)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:403)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:246)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:241)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:240)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1250)
> at sqlline.Commands.execute(Commands.java:822)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)



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


[jira] [Commented] (PHOENIX-2295) NullPointerException when parsing a query with hints in UNION ALL

2015-10-06 Thread Alicia Ying Shu (JIRA)

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

Alicia Ying Shu commented on PHOENIX-2295:
--

Attached patch.

> NullPointerException when parsing a query with hints in UNION ALL
> -
>
> Key: PHOENIX-2295
> URL: https://issues.apache.org/jira/browse/PHOENIX-2295
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.4.0
> Environment: Linux, phoenix phoenix-4.4.0-HBase-1.1
>Reporter: Gasper Metelko
>Assignee: Alicia Ying Shu
> Attachments: PHOENIX-2295.patch
>
>
> On the following db objects:
> CREATE TABLE table1 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE TABLE table2 (
>   id BIGINT,
>   col1 VARCHAR,
>   col2 VARCHAR,
>   CONSTRAINT pk PRIMARY KEY (id)) IMMUTABLE_ROWS=true;
>  
> CREATE INDEX INDEX_TABLE1_COL ON table1 (col1);
>  
> CREATE INDEX INDEX_TABLE2_COL ON table2 (col1);
> explain SELECT /*+ INDEX(table1 INDEX_TABLE1_COL) */ col1, col2 FROM table1 
> WHERE col1='123' UNION ALL SELECT /*+ INDEX(table2 INDEX_TABLE2_COL) */ col1, 
> col2 FROM table2 WHERE col1='123';
> On running the above statement there is a NPE:
> java.lang.NullPointerException
> at java.util.ArrayList.addAll(ArrayList.java:559)
> at 
> org.apache.phoenix.iterate.UnionResultIterators.(UnionResultIterators.java:51)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:131)
> at org.apache.phoenix.execute.UnionPlan.iterator(UnionPlan.java:127)
> at 
> org.apache.phoenix.execute.UnionPlan.getExplainPlan(UnionPlan.java:150)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:424)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$ExecutableExplainStatement.compilePlan(PhoenixStatement.java:403)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:246)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$1.call(PhoenixStatement.java:241)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeQuery(PhoenixStatement.java:240)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1250)
> at sqlline.Commands.execute(Commands.java:822)
> at sqlline.Commands.sql(Commands.java:732)
> at sqlline.SqlLine.dispatch(SqlLine.java:808)
> at sqlline.SqlLine.begin(SqlLine.java:681)
> at sqlline.SqlLine.start(SqlLine.java:398)
> at sqlline.SqlLine.main(SqlLine.java:292)



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