private static SqlTimestamp sqlTimestampOf(DateTime dateTime, ConnectorSession session) { return sqlTimestampOf(dateTime.getMillis(), session); }
private SqlTime toTime(LocalTime time) { return sqlTimeOf(time, session); }
Session session) return sqlTimestampOf( year, monthOfYear, return new SqlTimestamp(new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond, baseZone).getMillis(), timestampZone); return sqlTimestampOf(LocalDateTime.of(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, millisToNanos(millisOfSecond)));
public static SqlTime sqlTimeOf( int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, Session session) { LocalTime time = LocalTime.of(hourOfDay, minuteOfHour, secondOfMinute, millisToNanos(millisOfSecond)); return sqlTimeOf(time, session); }
public static SqlTime sqlTimeOf( int hourOfDay, int minuteOfHour, int secondOfMinute, int millisOfSecond, Session session) { LocalTime time = LocalTime.of(hourOfDay, minuteOfHour, secondOfMinute, millisToNanos(millisOfSecond)); return sqlTimeOf(time, session); }
private static SqlTimestamp sqlTimestampOf(DateTime dateTime, ConnectorSession session) { return sqlTimestampOf(dateTime.getMillis(), session); }
Session session) return sqlTimestampOf( year, monthOfYear, return new SqlTimestamp(new DateTime(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, millisOfSecond, baseZone).getMillis(), timestampZone); return sqlTimestampOf(LocalDateTime.of(year, monthOfYear, dayOfMonth, hourOfDay, minuteOfHour, secondOfMinute, millisToNanos(millisOfSecond)));
private SqlTime toTime(LocalTime time) { return sqlTimeOf(time, session); }
private static SqlTimestamp intToSqlTimestamp(Integer input) { if (input == null) { return null; } return sqlTimestampOf(input, SESSION); }
@Test public void testCastToTime() { assertFunction("cast(TIMESTAMP '2001-1-22 03:04:05.321' as time)", TIME, sqlTimeOf(3, 4, 5, 321, session)); }
private static SqlTimestamp intToSqlTimestamp(Integer input) { if (input == null) { return null; } return sqlTimestampOf(input, SESSION); }
@Test @Override public void testCastToTime() { assertFunction("cast(TIMESTAMP '2001-1-22 03:04:05.321 +07:09' as time)", TIME, sqlTimeOf(2 /* not 3 */, 4, 5, 321, session)); }
private static SqlTimestamp sqlTimestamp(int year, int month, int day, int hour, int minute, int second) { return sqlTimestampOf(year, month, day, hour, minute, second, 0, UTC, UTC_KEY, SESSION); } }
@Test @Override public void testCastToTime() { assertFunction("cast(TIME '03:04:05.321 +07:09' as time)", TIME, sqlTimeOf(2 /* not 3 */, 4, 5, 321, session)); }
public static SqlTimestamp sqlTimestampOf(DateTime dateTime, Session session) { return sqlTimestampOf(dateTime, session.toConnectorSession()); }
@Test @Override public void testCastToTime() { assertFunction("cast(TIME '03:04:05.321 +07:09' as time)", TIME, sqlTimeOf(3, 4, 5, 321, session)); }
public static SqlTimestamp sqlTimestampOf(DateTime dateTime, Session session) { return sqlTimestampOf(dateTime, session.toConnectorSession()); }
@Test @Override public void testCastToTime() { assertFunction("cast(TIME '03:04:05.321 +07:09' as time)", TIME, sqlTimeOf(2 /* not 3 */, 4, 5, 321, session)); }
@Test @Override public void testCastToTimestamp() { assertFunction("cast(TIME '03:04:05.321 +07:09' as timestamp)", TIMESTAMP, sqlTimestampOf(1970, 1, 1, 3, 4, 5, 321, session)); } }
@Test @Override public void testCastToTime() { assertFunction("cast(TIME '03:04:05.321 +07:09' as time)", TIME, sqlTimeOf(3, 4, 5, 321, session)); }