APISonar


com.facebook.presto.spi.type.StandardTypes.TIME

> com > facebook > presto > spi > type > StandardTypes > TIME
com APIs facebook APIs presto APIs spi APIs type APIs StandardTypes APIs TIME APIs

Example 1
public static long castToTime(ConnectorSession session, @SqlType(StandardTypes.TIME_WITH_TIME_ZONE) long value)
    {
        // This is exactly the same operation as for TIME WITH TIME ZONE -> TIMESTAMP, as the representations
        // of those types are aligned in range that is covered by TIME WITH TIME ZONE.
        return castToTimestamp(session, value);
    }
Example 2
public static long diffTime(ConnectorSession session, @SqlType(StandardTypes.VARCHAR) Slice unit, @SqlType(StandardTypes.TIME) long time1, @SqlType(StandardTypes.TIME) long time2)
    {
        ISOChronology chronology = getChronology(session.getTimeZoneKey());
        return getTimeField(chronology, unit).getDifferenceAsLong(time2, time1);
    }
Example 3
public static long timeMinusIntervalDayToSecond(ConnectorSession session, @SqlType(StandardTypes.TIME) long left, @SqlType(StandardTypes.INTERVAL_DAY_TO_SECOND) long right)
    {
        return modulo24Hour(getChronology(session.getTimeZoneKey()), left - right);
    }
Example 4
public static long castToTime(ConnectorSession session, @SqlType(StandardTypes.TIMESTAMP) long value)
    {
        if (session.isLegacyTimestamp()) {
            return modulo24Hour(getChronology(session.getTimeZoneKey()), value);
        }
        else {
            return modulo24Hour(value);
        }
    }