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

ramkrishna.s.vasudevan commented on PHOENIX-1705:
-------------------------------------------------

[~Dumindux]
Thanks for working on this.  Great work !!!.
Few comments
{code}
PDataType 
baseType=PDataType.fromTypeId(children.get(0).getDataType().getSqlType()
+                - PDataType.ARRAY_TYPE_BASE);
+        PDataType elementDataType=children.get(1).getDataType();
+
{code}
The baseType and elementDataType can be made instance level? So that you need 
not use them in evaluate once again.
Here,
{code}
   public static boolean appendItemToArray(Tuple tuple, ImmutableBytesWritable 
ptr,
+                                            Expression arrayExpr, byte[] 
elementBytes, int elementOffset, int elementLength, PDataType baseType, Integer 
maxLen){
{code}
You can only pass the ptrElement only here instead of elementBytes, 
elementOffset, elementLength.
The coercsion() checks looks fine. 
I need to review the !fixedWidth part once again.  As we don't handle trailing 
nulls I think appending would involve changing the last element seperator bytes 
only.
So it would also involve change in the offset array and the number of elements 
that we add.  Will check that part once again.

> 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, 
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function.patch, 
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function1.patch, 
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function2.patch, 
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function3.patch, 
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function4.patch
>
>




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

Reply via email to