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