fix(sink): json timestamptz
should contain UTC suffix Z
#13109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
In #9755
That PR changed from
1516991409.453000
to2018-01-26 18:30:09.453000
. This format is the only format accept by aninsert
intomysql/tidb
.However, the actual debezium output is
2018-01-26T18:30:09.453Z
, no matter it is from postgresql or mysql.https:/debezium/debezium/blob/main/debezium-core/src/main/java/io/debezium/time/ZonedTimestamp.java
Furthermore, RisingWave json source accepts
2018-01-26T18:30:09.453Z
but rejects2018-01-26 18:30:09.453000
since 1.2.To distinguish it from
timestamp
(without time zone), align with debezium as well as RisingWave's own json source, this PR changes the output format in the following cases:For compatibility, the old format is still used in the following cases:
It also provides a new option for new kafka / kinesis / pulsar append-only / upsert sinks to explicitly select the old format:
timestamptz.handling.mode = 'utc_without_suffix'
Just for a comparison of the different formats:
T
with zone2006-01-02T15:04:05Z
2006-01-02 15:04:05
2006-01-02 15:04:05+00
Z
or+00:00
but not+00
+00
+00
but rw+00:00
Z
or+00:00
but not+00
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
For sinks with
timestamptz
column usingjson
encoding, the output format changed from2018-01-26 18:30:09.453000
to2018-01-26T18:30:09.453000Z
.