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

James Taylor commented on PHOENIX-1055:
---------------------------------------

Thanks for the patch, [~kbuzsaki]. Would it be possible to fold this 
functionality into the ENCODE built-in? We already have support for HEX there.

Also, in the evaluate method, when you're working with BIGINT data types (or in 
general any Java primitive), you can avoid allocations of Long objects by going 
through the codec. For example, instead of this:
{code}
Long numericValue = (Long)PDataType.LONG.toObject(ptr, child.getDataType(), 
child.getSortOrder());
{code}

Do this:
{code}
long numericValue= child.getDataType().getCodec().decodeLong(ptr, 
child.getSortOrder());
{code}


> Add support for the built-in functions HEX, OCT, and BIN 
> ---------------------------------------------------------
>
>                 Key: PHOENIX-1055
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1055
>             Project: Phoenix
>          Issue Type: New Feature
>            Reporter: Kyle Buzsaki
>         Attachments: PHOENIX-1055.patch
>
>
> Add built-in functions to produce hexadecimal, octal, and binary string 
> representations of numeric values.
> Example Function Specification:
> http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_hex
> http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_oct
> http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_bin



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to