Class SqlFloorFunction


  • public class SqlFloorFunction
    extends SqlMonotonicUnaryFunction
    Definition of the "FLOOR" and "CEIL" built-in SQL functions.
    • Constructor Detail

      • SqlFloorFunction

        public SqlFloorFunction​(SqlKind kind)
    • Method Detail

      • replaceTimeUnitOperand

        public static SqlCall replaceTimeUnitOperand​(SqlCall call,
                                                     java.lang.String literal,
                                                     SqlParserPos pos)
        Copies a SqlCall, replacing the time unit operand with the given literal.
        Parameters:
        call - Call
        literal - Literal to replace time unit with
        pos - Parser position
        Returns:
        Modified call
      • unparseDatetimeFunction

        public static void unparseDatetimeFunction​(SqlWriter writer,
                                                   SqlCall call,
                                                   java.lang.String funName,
                                                   java.lang.Boolean datetimeFirst)
        Most dialects that natively support datetime floor will use this. In those cases the call will look like TRUNC(datetime, 'year').
        Parameters:
        writer - SqlWriter
        call - SqlCall
        funName - Name of the sql function to call
        datetimeFirst - Specify the order of the datetime & timeUnit arguments