[ https://issues.apache.org/jira/browse/PHOENIX-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14359462#comment-14359462 ]
Samarth Jain commented on PHOENIX-1705: --------------------------------------- [~Dumindux] - looking good. Here is some feedback: 1) Rename isCastable to coercionNeeded or something like that. 2) You would need to serialize isCastable so that it could be read on server side. See RoundDateExpression#readFields and #write methods for an example. Currently you are reading the default value of isCastable. 3) Add tests that would trigger the coercion code. For example - Adding integer to a string of varchars. 4) Add tests that invoke array_append in UPSERT and UPSERT SELECT statements. 5) Tests that calls some in-built function on the element being added. For ex - SELECT ARRAY_APPEND(INTEGERARRAY, ROUND(1.23)) FROM T 6) Remove the try catch here as the coerceBytes method isn't throwing any checked exception. {code} if(this.isCastable){ + try { + baseType.coerceBytes(ptr,elementExpr.getDataType(),elementExpr.getSortOrder(),arrayExpr.getSortOrder(),getMaxLength()); + } + catch (Exception e){ + return false; + } + } {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 > > -- This message was sent by Atlassian JIRA (v6.3.4#6332)