[jira] [Updated] (PHOENIX-2402) NPE when using UPSERT SELECT with a char array

2015-12-01 Thread James Taylor (JIRA)

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

James Taylor updated PHOENIX-2402:
--
Attachment: PHOENIX-2402_v2.patch

Patch looks good, [~jja...@marinsoftware.com]. I've made a couple of minor 
changes and will commit it shortly.

> NPE when using UPSERT SELECT with a char array
> --
>
> Key: PHOENIX-2402
> URL: https://issues.apache.org/jira/browse/PHOENIX-2402
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.5.2
>Reporter: Julian Jaffe
>Assignee: Julian Jaffe
>  Labels: patch
> Attachments: PHOENIX-2402.patch, PHOENIX-2402_v2.patch
>
>
> A NPE is thrown when attempting to UPSERT SELECT with a char array:
> {code:sql}
> CREATE TABLE IF NOT EXISTS TEST.TEST("testInt" INTEGER, "testCharArray" 
> CHAR(3)[] CONSTRAINT "test_test" PRIMARY KEY ("testInt")) 
> DEFAULT_COLUMN_FAMILY='TT', SALT_BUCKETS=10;
> No rows affected (1.631 seconds)
> 0: jdbc:phoenix:xx> UPSERT INTO TEST.TEST VALUES(5, ARRAY['aaa','bbb']);
> 1 row affected (0.164 seconds)
> 0: jdbc:phoenix:xx> SELECT * FROM TEST.TEST;
> +--+---+
> | testInt  | testCharArray |
> +--+---+
> | 5| ['aaa', 'bbb'] |
> +--+---+
> 1 row selected (0.364 seconds)
> 0: jdbc:phoenix:xx> UPSERT INTO TEST.TEST("testInt", "testCharArray") 
> SELECT "testInt", ARRAY['ccc'] FROM TEST.TEST WHERE "testInt" = 5;
> Error: java.lang.NullPointerException (state=08000,code=101)
> org.apache.phoenix.exception.PhoenixIOException: 
> java.lang.NullPointerException
> at 
> org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:108)
> at 
> org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:553)
> at 
> org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
> at 
> org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
> at 
> org.apache.phoenix.compile.UpsertCompiler$2.execute(UpsertCompiler.java:685)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:319)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:311)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:309)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1432)
> 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)
> Caused by: java.util.concurrent.ExecutionException: 
> java.lang.NullPointerException
> at java.util.concurrent.FutureTask.report(FutureTask.java:122)
> at java.util.concurrent.FutureTask.get(FutureTask.java:206)
> at 
> org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:549)
> ... 14 more
> Caused by: java.lang.NullPointerException
> {code}



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


[jira] [Updated] (PHOENIX-2402) NPE when using UPSERT SELECT with a char array

2015-11-11 Thread Julian Jaffe (JIRA)

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

Julian Jaffe updated PHOENIX-2402:
--
Attachment: PHOENIX-2402.patch

> NPE when using UPSERT SELECT with a char array
> --
>
> Key: PHOENIX-2402
> URL: https://issues.apache.org/jira/browse/PHOENIX-2402
> Project: Phoenix
>  Issue Type: Bug
>Affects Versions: 4.5.2
>Reporter: Julian Jaffe
> Attachments: PHOENIX-2402.patch
>
>
> A NPE is thrown when attempting to UPSERT SELECT with a char array:
> {code:sql}
> CREATE TABLE IF NOT EXISTS TEST.TEST("testInt" INTEGER, "testCharArray" 
> CHAR(3)[] CONSTRAINT "test_test" PRIMARY KEY ("testInt")) 
> DEFAULT_COLUMN_FAMILY='TT', SALT_BUCKETS=10;
> No rows affected (1.631 seconds)
> 0: jdbc:phoenix:xx> UPSERT INTO TEST.TEST VALUES(5, ARRAY['aaa','bbb']);
> 1 row affected (0.164 seconds)
> 0: jdbc:phoenix:xx> SELECT * FROM TEST.TEST;
> +--+---+
> | testInt  | testCharArray |
> +--+---+
> | 5| ['aaa', 'bbb'] |
> +--+---+
> 1 row selected (0.364 seconds)
> 0: jdbc:phoenix:xx> UPSERT INTO TEST.TEST("testInt", "testCharArray") 
> SELECT "testInt", ARRAY['ccc'] FROM TEST.TEST WHERE "testInt" = 5;
> Error: java.lang.NullPointerException (state=08000,code=101)
> org.apache.phoenix.exception.PhoenixIOException: 
> java.lang.NullPointerException
> at 
> org.apache.phoenix.util.ServerUtil.parseServerException(ServerUtil.java:108)
> at 
> org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:553)
> at 
> org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
> at 
> org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
> at 
> org.apache.phoenix.compile.UpsertCompiler$2.execute(UpsertCompiler.java:685)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:319)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:311)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:309)
> at 
> org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:1432)
> 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)
> Caused by: java.util.concurrent.ExecutionException: 
> java.lang.NullPointerException
> at java.util.concurrent.FutureTask.report(FutureTask.java:122)
> at java.util.concurrent.FutureTask.get(FutureTask.java:206)
> at 
> org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:549)
> ... 14 more
> Caused by: java.lang.NullPointerException
> {code}



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