public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return iGregorianField.getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return iField.getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return iGregorianField.getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant) / iDivisor; }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { int offset = getOffsetToAdd(subtrahendInstant); return iField.getDifferenceAsLong (minuendInstant + (iTimeField ? offset : getOffsetToAdd(minuendInstant)), subtrahendInstant + offset); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { int offset = getOffsetToAdd(subtrahendInstant); return iField.getDifferenceAsLong (minuendInstant + (iTimeField ? offset : getOffsetToAdd(minuendInstant)), subtrahendInstant + offset); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { checkLimits(minuendInstant, "minuend"); checkLimits(subtrahendInstant, "subtrahend"); return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
public long getDifferenceAsLong(long minuendInstant, long subtrahendInstant) { checkLimits(minuendInstant, "minuend"); checkLimits(subtrahendInstant, "subtrahend"); return getWrappedField().getDifferenceAsLong(minuendInstant, subtrahendInstant); }
@Description("difference of the given dates in the given unit") @ScalarFunction("date_diff") @LiteralParameters("x") @SqlType(StandardTypes.BIGINT) public static long diffDate(ConnectorSession session, @SqlType("varchar(x)") Slice unit, @SqlType(StandardTypes.DATE) long date1, @SqlType(StandardTypes.DATE) long date2) { return getDateField(UTC_CHRONOLOGY, unit).getDifferenceAsLong(DAYS.toMillis(date2), DAYS.toMillis(date1)); }
@Description("difference of the given times in the given unit") @ScalarFunction("date_diff") @LiteralParameters("x") @SqlType(StandardTypes.BIGINT) public static long diffTime(ConnectorSession session, @SqlType("varchar(x)") Slice unit, @SqlType(StandardTypes.TIME) long time1, @SqlType(StandardTypes.TIME) long time2) { if (session.isLegacyTimestamp()) { // Session zone could have policy change on/around 1970-01-01, so we cannot use UTC ISOChronology chronology = getChronology(session.getTimeZoneKey()); return getTimeField(chronology, unit).getDifferenceAsLong(time2, time1); } return getTimeField(UTC_CHRONOLOGY, unit).getDifferenceAsLong(time2, time1); }
@Description("difference of the given times in the given unit") @ScalarFunction("date_diff") @LiteralParameters("x") @SqlType(StandardTypes.BIGINT) public static long diffTimestamp( ConnectorSession session, @SqlType("varchar(x)") Slice unit, @SqlType(StandardTypes.TIMESTAMP) long timestamp1, @SqlType(StandardTypes.TIMESTAMP) long timestamp2) { if (session.isLegacyTimestamp()) { return getTimestampField(getChronology(session.getTimeZoneKey()), unit).getDifferenceAsLong(timestamp2, timestamp1); } return getTimestampField(UTC_CHRONOLOGY, unit).getDifferenceAsLong(timestamp2, timestamp1); }
@Description("difference of the given times in the given unit") @ScalarFunction("date_diff") @LiteralParameters("x") @SqlType(StandardTypes.BIGINT) public static long diffTimestampWithTimeZone( @SqlType("varchar(x)") Slice unit, @SqlType(StandardTypes.TIMESTAMP_WITH_TIME_ZONE) long timestampWithTimeZone1, @SqlType(StandardTypes.TIMESTAMP_WITH_TIME_ZONE) long timestampWithTimeZone2) { return getTimestampField(unpackChronology(timestampWithTimeZone1), unit).getDifferenceAsLong(unpackMillisUtc(timestampWithTimeZone2), unpackMillisUtc(timestampWithTimeZone1)); }
@Description("difference of the given times in the given unit") @ScalarFunction("date_diff") @LiteralParameters("x") @SqlType(StandardTypes.BIGINT) public static long diffTimeWithTimeZone( @SqlType("varchar(x)") Slice unit, @SqlType(StandardTypes.TIME_WITH_TIME_ZONE) long timeWithTimeZone1, @SqlType(StandardTypes.TIME_WITH_TIME_ZONE) long timeWithTimeZone2) { return getTimeField(unpackChronology(timeWithTimeZone1), unit).getDifferenceAsLong(unpackMillisUtc(timeWithTimeZone2), unpackMillisUtc(timeWithTimeZone1)); }