File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
airbyte-db/db-lib/src/main/java/io/airbyte/db Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public class DataTypeUtils {
3131 public static final DateTimeFormatter TIMETZ_FORMATTER = DateTimeFormatter .ofPattern ("HH:mm:ss.SSSSSSXXX" );
3232 public static final DateTimeFormatter TIMESTAMPTZ_FORMATTER = DateTimeFormatter .ofPattern ("yyyy-MM-dd'T'HH:mm:ss.SSSSSSXXX" );
3333 public static final DateTimeFormatter OFFSETDATETIME_FORMATTER = DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss.SSSSSSS XXX" );
34+ public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter .ofPattern ("yyyy-MM-dd" );
3435
3536 // wrap SimpleDateFormat in a function because SimpleDateFormat is not threadsafe as a static final.
3637 public static DateFormat getDateFormat () {
Original file line number Diff line number Diff line change 44
55package io .airbyte .db .jdbc ;
66
7+ import static io .airbyte .db .DataTypeUtils .DATE_FORMATTER ;
78import static io .airbyte .db .DataTypeUtils .TIMESTAMPTZ_FORMATTER ;
89import static io .airbyte .db .DataTypeUtils .TIMESTAMP_FORMATTER ;
910import static io .airbyte .db .DataTypeUtils .TIMETZ_FORMATTER ;
@@ -101,10 +102,7 @@ public static String convertToDate(final Object date) {
101102 return resolveEra (d , localDate .toString ());
102103 } else if (date instanceof LocalDate d ) {
103104 // Incremental mode
104- if (isBce (d )) {
105- d = d .minusYears (1 );
106- }
107- return resolveEra (d , d .toString ());
105+ return resolveEra (d , d .format (DATE_FORMATTER ));
108106 } else {
109107 final LocalDate localDate = LocalDate .parse (date .toString ());
110108 return resolveEra (localDate , localDate .toString ());
You can’t perform that action at this time.
0 commit comments