phoenix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dumindu Buddhika (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PHOENIX-1705) implement ARRAY_APPEND built in function
Date Sun, 08 Mar 2015 06:16:39 GMT

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

Dumindu Buddhika commented on PHOENIX-1705:
-------------------------------------------

Hi [~jamestaylor],

I have implemented a built in function for ARRAY_APPEND it is only intended for fixed length
arrays for now. But I have got a problem. I wrote a simple test for the function created.
its all in the patch file. but when I run the test I get an exception, but I cant seem to
find the direct reason for this exception. Can you take a look at the code segment and tell
me what you think? I must be doing something wrong(may be while appending the element to array).

the exception is,

java.lang.NullPointerException
	at org.apache.phoenix.schema.types.PArrayDataType.createPhoenixArray(PArrayDataType.java:624)
	at org.apache.phoenix.schema.types.PArrayDataType.toObject(PArrayDataType.java:263)
	at org.apache.phoenix.schema.types.PBinaryArray.toObject(PBinaryArray.java:67)
	at org.apache.phoenix.schema.types.PDataType.toObject(PDataType.java:996)
	at org.apache.phoenix.compile.ExpressionProjector.getValue(ExpressionProjector.java:75)
	at org.apache.phoenix.jdbc.PhoenixResultSet.getArray(PhoenixResultSet.java:182)
	at org.apache.phoenix.end2end.salted.ArrayAppendFunctionIT.testArray(ArrayAppendFunctionIT.java:57)

Here ArrrayAppendFunctionIT is the simple test case I wrote.

What I understood after looking for a while is this exception occurs since PArrayDataType.toObject
method does not receive array type correctly So when it calls getByteSize of data type object
it gets null. 

Regards,
Dumindu.

> implement ARRAY_APPEND built in function
> ----------------------------------------
>
>                 Key: PHOENIX-1705
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1705
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Dumindu Buddhika
>            Assignee: Dumindu Buddhika
>         Attachments: PHOENIX-1705_implement_ARRAY_APPEND_built_in_function.patch
>
>




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

Mime
View raw message