You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@phoenix.apache.org by "Thomas D'Silva (JIRA)" <ji...@apache.org> on 2015/02/10 02:10:34 UTC

[jira] [Commented] (PHOENIX-688) Add to_time and to_timestamp built-in functions

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

Thomas D'Silva commented on PHOENIX-688:
----------------------------------------

+1 this patch also fixes a b/w compat issue between 4.3 server and 4.2.1 client.

> Add to_time and to_timestamp built-in functions
> -----------------------------------------------
>
>                 Key: PHOENIX-688
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-688
>             Project: Phoenix
>          Issue Type: Task
>    Affects Versions: 3.0-Release
>            Reporter: James Taylor
>            Assignee: James Taylor
>         Attachments: PHOENIX-688.patch, PHOENIX-688_v2.patch, PHOENIX-688_v3.patch
>
>
> We already have a to_date function implemented by ToDateFunction, so adding a ToTimeFunction could be done by just deriving the class from ToDateFunction and changing the getDataType() to be PDataType.TIME instead.
> For a general overview on adding a new built-in function, see the phoenix blog [here](http://phoenix-hbase.blogspot.com/2013/04/how-to-add-your-own-built-in-function.html)
> The to_timestamp function would be similar as well, but in this case we'd want to register a new ToTimestampParseNode (very similar to ToDateParseNode), that uses the DateUtil.getTimestampParser(format) to create the timestamp instance. This class would then be defined in the ToTimestampFunction as the nodeClass attribute (which would cause it to be used to construct a ToTimestampFunction at compile time).



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