[
https://issues.apache.org/jira/browse/PHOENIX-777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14541938#comment-14541938
]
Kathiresan Selvaraj commented on PHOENIX-777:
---------------------------------------------
Dumindu, I haven't tested all the cases you have mentioned, but the i've tested
PLongArray (I believe this is the BIGINT ARRAY sql data type). I get an
exception, instead of 0's.
CREATE TABLE BIARRAYNULLTEST1 (ID VARCHAR, SALES BIGINT ARRAY CONSTRAINT PK
PRIMARY KEY (ID))
UPSERT INTO BIARRAYNULLTEST1 (ID, SALES) VALUES('123',ARRAY[1,2,null])
org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type
mismatch. INTEGER and DECIMAL for -1.010E+126
at
org.apache.phoenix.schema.TypeMismatchException.newException(TypeMismatchException.java:53)
at
org.apache.phoenix.expression.LiteralExpression.newConstant(LiteralExpression.java:171)
at
org.apache.phoenix.expression.LiteralExpression.newConstant(LiteralExpression.java:143)
at
org.apache.phoenix.expression.LiteralExpression.newConstant(LiteralExpression.java:135)
at
org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:1561)
at
org.apache.phoenix.compile.ExpressionCompiler.visitLeave(ExpressionCompiler.java:141)
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)
> Support null value for fixed length ARRAY
> -----------------------------------------
>
> Key: PHOENIX-777
> URL: https://issues.apache.org/jira/browse/PHOENIX-777
> Project: Phoenix
> Issue Type: Task
> Reporter: James Taylor
> Assignee: Dumindu Buddhika
>
> A null value for a fixed length array can be handled with a bitset tacked on
> the end of the array. If an element is set to null, then the bit at that
> index is set. Trailing nulls are not stored and an attempt to access an array
> past the current size returns null.
> Current behavior,
> PBinaryArray - Throws an exception when a null is inserted.
> PBooleanArray - null is considered as false when a null is inserted.
> PCharArray - Throws an exception when a null is inserted.
> PDateArray - Throws an exception when a null is inserted.
> PDoubleArray - null is considered as 0.0 when a null is inserted.
> PFloatArray - null is considered as 0.0 when a null is inserted.
> PIntegerArray - null is considered as 0 when a null is inserted.
> PLongArray - null is considered as 0 when a null is inserted.
> PSmallIntArray - null is considered as 0 when a null is inserted.
> PTimeArray - Throws an exception when a null is inserted.
> PTimeStampArray - Throws an exception when a null is inserted.
> PTinyIntArray - null is considered as 0 when a null is inserted.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)