Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-688

Add to_time and to_timestamp built-in functions

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Resolution: Fixed
    • 3.0-Release
    • 4.3.0
    • None
    • None
    • 557

    Description

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

      Attachments

        1. PHOENIX-688.patch
          23 kB
          Alicia Ying Shu
        2. PHOENIX-688_v3.patch
          71 kB
          James R. Taylor
        3. PHOENIX-688_v2.patch
          68 kB
          James R. Taylor

        Activity

          People

            jamestaylor James R. Taylor
            jamestaylor James R. Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: