Class SqlFunctions.DateFormatFunction

java.lang.Object
org.apache.calcite.runtime.SqlFunctions.DateFormatFunction
Enclosing class:
SqlFunctions

public static class SqlFunctions.DateFormatFunction extends Object
State for FORMAT_DATE, FORMAT_TIMESTAMP, FORMAT_DATETIME, FORMAT_TIME, TO_CHAR functions.
  • Constructor Details

    • DateFormatFunction

      public DateFormatFunction()
  • Method Details

    • withElements

      protected final void withElements(FormatModel formatModel, String format, Consumer<List<FormatElement>> consumer)
      Given a format string and a format model, calls an action with the list of elements obtained by parsing that format string.
    • formatTimestamp

      public String formatTimestamp(String fmtString, long timestamp)
    • toChar

      public String toChar(long timestamp, String pattern)
    • toDate

      public int toDate(String dateString, String fmtString)
    • toTimestamp

      public long toTimestamp(String timestampString, String fmtString)
    • formatDate

      public String formatDate(String fmtString, int date)
    • formatTime

      public String formatTime(String fmtString, int time)