Skip to content
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

[source-mssql] update datetimeoffset format #45142

Merged
merged 9 commits into from
Sep 5, 2024
Merged

Conversation

xiaohansong
Copy link
Contributor

@xiaohansong xiaohansong commented Sep 4, 2024

What

#42957

Now datetimeoffset is formatted under airbyte protocol, we need to be able to parse it back.

  • writing in state we need to save it in a correct format (using mssql source operation)
  • reading out of state we should use TIMESTAMP_TZ formatter.

How

Review guide

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Sep 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Sep 5, 2024 1:30am

@octavia-squidington-iii octavia-squidington-iii added area/connectors Connector related issues CDK Connector Development Kit connectors/source/mssql labels Sep 4, 2024
@octavia-squidington-iii octavia-squidington-iii removed the CDK Connector Development Kit label Sep 4, 2024
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Sep 4, 2024
@xiaohansong xiaohansong marked this pull request as ready for review September 4, 2024 22:52
@xiaohansong xiaohansong requested a review from a team as a code owner September 4, 2024 22:52
@@ -183,7 +183,7 @@ public JsonSchemaType getAirbyteType(final JDBCType jdbcType) {
protected void setTimestampWithTimezone(final PreparedStatement preparedStatement, final int parameterIndex, final String value)
throws SQLException {
try {
final OffsetDateTime offsetDateTime = OffsetDateTime.parse(value, OFFSETDATETIME_FORMATTER);
final OffsetDateTime offsetDateTime = OffsetDateTime.parse(value, TIMESTAMPTZ_FORMATTER);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will be consistent with other places (DBZ) we use to parse MSSQL datetime offset

@xiaohansong xiaohansong enabled auto-merge (squash) September 4, 2024 22:56
@theyueli
Copy link
Contributor

theyueli commented Sep 5, 2024

the integration test caught this change well :-) thanks for the fix!

@xiaohansong xiaohansong merged commit 458e96e into master Sep 5, 2024
34 of 35 checks passed
@xiaohansong xiaohansong deleted the xiaohan/mssqldate branch September 5, 2024 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/source/mssql
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants