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

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

Add an getElementExpr().getDataType().getByteSize() == null condition as well. 
I forgot that expression.getMaxLength() returns the maximum precision for the 
underlying datatype. What we're trying to do is only check the max length for 
parameterized types, for example CHAR(15) or BINARY(30), where the max length 
is accessed via the expression. This getByteSize() == null check will rule out 
any fixed width types such as INTEGER, SMALLINT, etc. 

Regarding handling the null case, the general way of checking that is 
expression.getDataType() == null, so you'll likely need to check for this in 
the constructor as well.

The thing to avoid is checking for a particular data type instance, as that'll 
break down if/when new data types are added.

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

Reply via email to