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

James Taylor commented on PHOENIX-1705:
---------------------------------------

[~ramkrishna] - would you have a few spare cycles to review?

One thing I noticed is that you should use System.arraycopy(src, srcPos, dest, 
destPos, length) instead of the for loops to copy the bytes.

Also, one good test would be when an array crosses over from using a short to 
using an int.

And one more comment, change this constructor to throw a TypeMismatchException 
instead:
{code}
+    public ArrayAppendFunction(List<Expression> children) throws SQLException {
+
+        super(children);
+        
if(!children.get(1).getDataType().equals(PDataType.fromTypeId(children.get(0).getDataType().getSqlType()
+                - PDataType.ARRAY_TYPE_BASE))){
+            
if(!children.get(1).getDataType().isCastableTo(PDataType.fromTypeId(children.get(0).getDataType().getSqlType()
+                    - PDataType.ARRAY_TYPE_BASE))){
+                throw new IllegalArgumentException("Input element data type 
mismatch");
+            }
+        }
+
+    }
+
{code}


> 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
>
>




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

Reply via email to