You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "James Taylor (JIRA)" <ji...@apache.org> on 2015/07/26 08:15:04 UTC

[jira] [Commented] (PHOENIX-2140) Implement get_byte/set_byte/get_bit/set_bit Binary String build-in function

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

James Taylor commented on PHOENIX-2140:
---------------------------------------

Thanks, [~shuxi0ng]. Nice work. I think there is potential for optimization with GET_BYTE and GET_BIT when the second argument is a constant value of 0. Another similar example that you can look at is the SUBSTR built-in function. See PrefixFunction (the base class for SubstrFunction and RegExSubstrFunction for an example and in particular the newKeyPart() and getKeyFormationTraversalIndex() implementation). By implementing these, usage of these functions can contribute to the start/stop row of the scan in queries like this:
{code}
SELECT * FROM T WHERE GET_BYTE(foo,0)  = 1;
{code}
See unit tests in WhereOptimizerTest for how the start/stop row of the scan is set and tested.

[~samarthjain] - would you have a few cycles to review this patch?

> Implement get_byte/set_byte/get_bit/set_bit Binary String build-in function
> ---------------------------------------------------------------------------
>
>                 Key: PHOENIX-2140
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-2140
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Shuxiong Ye
>            Assignee: Shuxiong Ye
>         Attachments: 0001-PHOENIX-2140-Implement-get_byte-set_byte-get_bit-set.patch
>
>
> see PHOENIX-1664



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)