Skip to content

Commit

Permalink
Merge branch 'master' into update-artie
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 authored Sep 24, 2024
2 parents 4dd9356 + e09b5a6 commit 94335b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/debezium/converters/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ func (ZonedTimestampConverter) ToField(name string) debezium.Field {
return debezium.Field{
FieldName: name,
Type: debezium.String,
DebeziumType: debezium.DateTimeWithTimezone,
DebeziumType: debezium.ZonedTimestamp,
}
}

Expand Down
8 changes: 4 additions & 4 deletions lib/debezium/converters/time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func TestZonedTimestampConverter_Convert(t *testing.T) {
assert.Equal(t, "2001-02-03T04:05:00Z", value)

// Check Transfer to ensure no precision loss
ts, err := converters.DateTimeWithTimezone{}.Convert(value)
ts, err := converters.ZonedTimestamp{}.Convert(value)
assert.NoError(t, err)
assert.Equal(t, _ts, ts.(*ext.ExtendedTime).GetTime())
}
Expand All @@ -304,7 +304,7 @@ func TestZonedTimestampConverter_Convert(t *testing.T) {
assert.Equal(t, "2001-02-03T04:05:01.0009Z", value)

// Check Transfer to ensure no precision loss
ts, err := converters.DateTimeWithTimezone{}.Convert(value)
ts, err := converters.ZonedTimestamp{}.Convert(value)
assert.NoError(t, err)
assert.Equal(t, _ts, ts.(*ext.ExtendedTime).GetTime())
}
Expand All @@ -316,7 +316,7 @@ func TestZonedTimestampConverter_Convert(t *testing.T) {
assert.Equal(t, "2001-02-03T04:05:01.000909Z", value)

// Check Transfer to ensure no precision loss
ts, err := converters.DateTimeWithTimezone{}.Convert(value)
ts, err := converters.ZonedTimestamp{}.Convert(value)
assert.NoError(t, err)
assert.Equal(t, _ts, ts.(*ext.ExtendedTime).GetTime())
}
Expand All @@ -328,7 +328,7 @@ func TestZonedTimestampConverter_Convert(t *testing.T) {
assert.Equal(t, "2001-02-03T03:05:00Z", value)

// Check Transfer to ensure no precision loss
ts, err := converters.DateTimeWithTimezone{}.Convert(value)
ts, err := converters.ZonedTimestamp{}.Convert(value)
assert.NoError(t, err)
assert.Equal(t, _ts.UTC(), ts.(*ext.ExtendedTime).GetTime())
}
Expand Down

0 comments on commit 94335b2

Please sign in to comment.