-
Notifications
You must be signed in to change notification settings - Fork 134
[SQL] Support for TIMESTAMP WITH TIME ZONE #6116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,8 @@ pub struct SqlSerdeConfig { | |
| pub date_format: DateFormat, | ||
| /// `TIMESTAMP` format. | ||
| pub timestamp_format: TimestampFormat, | ||
| /// `TIMESTAMP WITH TIME ZONE` format. | ||
| pub timestamp_tz_format: TimestampFormat, | ||
| /// `DECIMAL` format. | ||
| pub decimal_format: DecimalFormat, | ||
| /// `VARIANT` format | ||
|
|
@@ -190,6 +192,7 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| time_format: TimeFormat::Millis, | ||
| date_format: DateFormat::DaysSinceEpoch, | ||
| timestamp_format: TimestampFormat::MillisSinceEpoch, | ||
| timestamp_tz_format: TimestampFormat::MillisSinceEpoch, | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::JsonString, | ||
| binary_format: BinaryFormat::Array, | ||
|
|
@@ -198,7 +201,9 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| JsonFlavor::DebeziumMySql => Self { | ||
| time_format: TimeFormat::Micros, | ||
| date_format: DateFormat::DaysSinceEpoch, | ||
| // Why is this missing fractions of second? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Still here from prior review. Either answer the question (does Debezium MySQL really emit second-precision timestamps in this layout? — if so, say so) or open an issue and reference it. Don't ship a TODO disguised as a question. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This rhetorical TODO comment is still here from my first review. Either answer it (does Debezium MySQL truly emit second-precision timestamps in this flavor? — confirm and replace with a single-sentence explanation citing the upstream behaviour) or delete it. Floating questions to nobody are noise. Not a blocker. |
||
| timestamp_format: TimestampFormat::String("%Y-%m-%dT%H:%M:%S%Z"), | ||
| timestamp_tz_format: TimestampFormat::String("%Y-%m-%dT%H:%M:%S%Z"), | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::JsonString, | ||
| binary_format: BinaryFormat::Array, | ||
|
|
@@ -208,6 +213,7 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| time_format: TimeFormat::Micros, | ||
| date_format: DateFormat::DaysSinceEpoch, | ||
| timestamp_format: TimestampFormat::MillisSinceEpoch, | ||
| timestamp_tz_format: TimestampFormat::MillisSinceEpoch, | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::JsonString, | ||
| binary_format: BinaryFormat::Array, | ||
|
|
@@ -217,6 +223,7 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| time_format: TimeFormat::String("%H:%M:%S%.f"), | ||
| date_format: DateFormat::String("%Y-%m-%d"), | ||
| timestamp_format: TimestampFormat::String("%Y-%m-%dT%H:%M:%S%.f%:z"), | ||
| timestamp_tz_format: TimestampFormat::String("%Y-%m-%dT%H:%M:%S%.f%:z"), | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::JsonString, | ||
| binary_format: BinaryFormat::Array, | ||
|
|
@@ -226,6 +233,7 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| time_format: TimeFormat::String("%H:%M:%S%.f"), | ||
| date_format: DateFormat::String("%Y-%m-%d"), | ||
| timestamp_format: TimestampFormat::MillisSinceEpoch, | ||
| timestamp_tz_format: TimestampFormat::MillisSinceEpoch, | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::JsonString, | ||
| binary_format: BinaryFormat::Array, | ||
|
|
@@ -239,6 +247,7 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| time_format: TimeFormat::Nanos, | ||
| date_format: DateFormat::String("%Y-%m-%d"), | ||
| timestamp_format: TimestampFormat::String("%Y-%m-%d %H:%M:%S.%f %:z"), // 2023-11-04 15:33:47.123 +00:00 | ||
| timestamp_tz_format: TimestampFormat::String("%Y-%m-%d %H:%M:%S.%f %:z"), // 2023-11-04 15:33:47.123 +00:00 | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::JsonString, | ||
| binary_format: BinaryFormat::Base64, | ||
|
|
@@ -251,6 +260,7 @@ impl From<JsonFlavor> for SqlSerdeConfig { | |
| time_format: TimeFormat::default(), // H-M-S | ||
| date_format: DateFormat::default(), // Y-m-d | ||
| timestamp_format: TimestampFormat::default(), | ||
| timestamp_tz_format: TimestampFormat::default(), | ||
| decimal_format: DecimalFormat::String, | ||
| variant_format: VariantFormat::Json, | ||
| // We need [`BinaryFormat::PgHex`] only because we serialize | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stray
// Why is this missing fractions of second?comment with a question to nobody. Either answer it (Debezium MySQL really does emit second-precision timestamps in this layout) or open an issue and reference it. Don't ship a TODO disguised as a question.