You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "ramkrishna.s.vasudevan (JIRA)" <ji...@apache.org> on 2015/12/08 11:55:11 UTC
[jira] [Updated] (PHOENIX-1949) NPE while inserting NULL in a
VARCHAR array using UPSERT stmt
[ https://issues.apache.org/jira/browse/PHOENIX-1949?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ramkrishna.s.vasudevan updated PHOENIX-1949:
--------------------------------------------
Attachment: Phoenix-1949_1.patch
Patch as per James suggestion. Verified all other subclasses and it seems fine every where.
> NPE while inserting NULL in a VARCHAR array using UPSERT stmt
> -------------------------------------------------------------
>
> Key: PHOENIX-1949
> URL: https://issues.apache.org/jira/browse/PHOENIX-1949
> Project: Phoenix
> Issue Type: Bug
> Reporter: ramkrishna.s.vasudevan
> Assignee: ramkrishna.s.vasudevan
> Attachments: PVarcharFix.patch, Phoenix-1949.patch, Phoenix-1949_1.patch
>
>
> With reference to the mail in user list there is an NPE when upserting NULL in an VARCHAR array as reported by Kathir
> {code}
> Is it possible to insert null elements in an array type column?
> CREATE TABLE ARRAYTEST124 (ID VARCHAR, NAME VARCHAR ARRAY CONSTRAINT PK PRIMARY KEY(ID))
> UPSERT INTO ARRAYTEST124 (ID, NAME) VALUES('123',ARRAY['ABC','XYZ',null])
> UPSERT INTO ARRAYTEST124 (ID, NAME) VALUES('123',ARRAY['ABC',null,'XYZ'])
> UPSERT INTO ARRAYTEST124 (ID, NAME) VALUES('123',ARRAY[null,'ABC','XYZ'])
> I'm using phoenix 4.4.0-HBase-0.98-rc0
> I'm getting a null pointer exception, while trying to do the above upserts
> java.lang.NullPointerException
> at org.apache.phoenix.schema.types.PVarchar.toObject(PVarchar.java:62)
> at org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:979)
> at org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:992)
> at org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:1275)
> at org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:142)
> at org.apache.phoenix.parse.ArrayConstructorNode.accept(ArrayConstructorNode.java:43)
> at org.apache.phoenix.compile.UpsertCompiler.compile(UpsertCompiler.java:733)
> at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:525)
> at org.apache.phoenix.jdbc.PhoenixStatement$ExecutableUpsertStatement.compilePlan(PhoenixStatement.java:513)
> at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:299)
> at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:292)
> at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
> at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:290)
> at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStatement.java:222)
> at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:173)
> at org.apache.phoenix.jdbc.PhoenixPreparedStatement.execute(PhoenixPreparedStatement.java:178)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)