[
https://issues.apache.org/jira/browse/PHOENIX-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14393054#comment-14393054
]
James Taylor commented on PHOENIX-1705:
---------------------------------------
Thanks for the detailed feedback, [~Dumindux]. Your unit tests are doing their
job. :-) Add one more condition to that if, to check that the elementExp data
type is also fixed width:
{code}
// If the base type of an element is fixed width, make sure the element
being appended will fit
if (getBaseType().isFixedWidth() && getArrayExpr().getMaxLength() !=
null &&
getElementExpr().getDataType().isFixedWidth() &&
getElementExpr().getMaxLength() != null &&
getElementExpr().getMaxLength() > getArrayExpr().getMaxLength()) {
throw new DataExceedsCapacityException("");
}
{code}
For the second case, I suspect the problem is isolated to just when null is
passed in as an argument. I think for the null case, you can add checks for
getArrayExpr().getDataType() != null. Might need check for getBaseType() !=
null too. Try doing an ARRAY_APPEND(null,null).
> 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_function10.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,
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function5.patch,
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function6.patch,
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function7.patch,
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function8.patch,
> PHOENIX-1705_implement_ARRAY_APPEND_built_in_function9.patch
>
>
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)