You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Dumindu Buddhika (JIRA)" <ji...@apache.org> on 2015/04/03 05:24:52 UTC
[jira] [Comment Edited] (PHOENIX-1705) implement ARRAY_APPEND built
in function
[ https://issues.apache.org/jira/browse/PHOENIX-1705?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14394011#comment-14394011 ]
Dumindu Buddhika edited comment on PHOENIX-1705 at 4/3/15 3:24 AM:
-------------------------------------------------------------------
Thanks for the suggestions [~jamestaylor],
For the first case, actually element comes as FixedWidth(it comes as an Integer). So adding getElementExpr().getDataType().isFixedWidth() condition did not work since the elementType is "integer" and maxLength returns a 10. That is the problem. Can you think why this happens?
For the second case, when ARRAY_APPEND(null,null), getArrayExpr().getDataType() returns null . But since null values are allowed for element,
{code} @FunctionParseNode.Argument(allowedTypes = {PVarbinary.class},defaultValue = "null")}{code}
getElementExpr().getDataType() returns "PVarBinary". So {code}ARRAY_APPEND(ARRAY[2,3],null){code} still fails at constructor(coercion check. Here we have to return the input array itself). how should I go about this?
was (Author: dumindux):
Thanks for the suggestions [~jamestaylor],
For the first case, actually element comes as FixedWidth(it comes as an Integer). So adding getElementExpr().getDataType().isFixedWidth() condition did not work since the elementType is "integer" and maxLength returns a 10. That is the problem. Can you think why this happens?
For the second case, when ARRAY_APPEND(null,null), getArrayExpr().getDataType() returns null . But since null values are allowed for element,
{code} @FunctionParseNode.Argument(allowedTypes = {PVarbinary.class},defaultValue = "null")}{code}
getElementExpr().getDataType() returns "PVarBinary". So {code}ARRAY_APPEND(ARRAY[2,3],null){code} still fails at constructor(coercion check. Here we have to return the input array itself). how should I go about this? Having !getElementExpr().isNullable() in the coercion check condition solves the problem. Is it ok to do so?
> 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)