-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 Snowflake: fix coercion-to-UTC for timestamp datasource #31631
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Before Merging a Connector Pull RequestWow! What a great pull request you have here! 🎉 To merge this PR, ensure the following has been done/considered for each connector added or updated:
If the checklist is complete, but the CI check is failing,
|
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/x86_64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ❌ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
@@ -20,7 +20,7 @@ data: | |||
name: Paypal Transaction |
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.
This file should be reverted
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.
yeah, that's a bug in our approve-and-merge pipeline. The automatic formatting should have kicked in but it didn't, and as a result, another random change updated that file: https://github.com/airbytehq/airbyte/pull/31610/files
source-paypal-transaction test report (commit
|
Step | Result |
---|---|
Build source-paypal-transaction docker image for platform(s) linux/x86_64 | ✅ |
Acceptance tests | ✅ |
Code format checks | ✅ |
Validate metadata for source-paypal-transaction | ✅ |
Connector version semver check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-paypal-transaction test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/x86_64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ❌ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
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.
Looks good! Couple of high-level comments :
- We should bump the version of the snowflake connector in the metadata.yaml : (airbyte-integrations/connectors/source-snowflake/metadata.yaml). This deploys a new version of the source-snowflake connector in cloud.
- We need to add to the changelog in docs/integrations/sources/snowflake.md outlining the change.
- [Optional] : We should add a quick blurb about the weirdness in handling timestamp_tz in snowflake.
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.
We can look into defaulting some of these JDBC params while connecting to snowflake in the future while creating a connection, but for now I think this works
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/x86_64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ❌ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
|
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/x86_64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
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.
this file is really annoying to diff, but the only difference is in columns 24 and 26, where we get 00:00:00-07:00
and 00:12:00+05:00
respectively instead of 00:07:00Z
(Where Z
means UTC)
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.
those comments are only here to facilitate debugging when a CAT fails. The sorting is to improve it further, so a simple diff can do
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
0938e4b
to
01f4046
Compare
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ❌ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ✅ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
source-snowflake test report (commit
|
Step | Result |
---|---|
Build connector tar | ✅ |
Java Connector Unit Tests | ✅ |
Build source-snowflake docker image for platform(s) linux/amd64 | ✅ |
Acceptance tests | ✅ |
Java Connector Integration Tests | ✅ |
Validate metadata for source-snowflake | ✅ |
Connector version semver check | ✅ |
Connector version increment check | ✅ |
QA checks | ✅ |
☁️ View runs for commit in Dagger Cloud
Please note that tests are only run on PR ready for review. Please set your PR to draft mode to not flood the CI engine and upstream service on following commits.
You can run the same pipeline locally on this branch with the airbyte-ci tool with the following command
airbyte-ci connectors --name=source-snowflake test
What
fixes #31568
When exporting a timestamp_tz column, we lose the timeoffset information, and get the timestamp at UTC (for example, 2023-08-01T00:00:00.000-07:00 will become 2023-08-01T00:07:00.000Z).
Per snowflake documentation, a timestamp_tz is really a UTC timestamp with a timezone associated to it, so when we read a timestamp_tz as a java timestamp, we get the UTC time.
This is not a very resilient change, but the existing code was even more brittle.
In addition, this change reduces the precision of snowflake's timestamp_tz to ms (TIME(3))), while they might be stored as TIME(9) (with ns precision)
How
snowflake doesn't support custom datatype mapping, so a timestamp_tz is always mapped to a java Timestamp (without timezone information).
The default behavior that forces a mapping to OffsetDateTime is not applicable here.
Instead, we have to get the column value as a String and parse it to get the OffsetDateTime, and then write that as a JSON object.
Unfortunately, even that behavior is brittle. There are a bunch of parameters that affect the seriazliation of timestamp columns :
JDBC_TREAT_TIMESTAMP_NTZ_AS_UTC (should be set to true)
JDBC_USE_SESSION_TIMEZONE (should be set to false)
TIMESTAMP_TYPE_MAPPING should be set to
'TIMESTAMP_TZ'
for maximum accuracyTIMESTAMP_LTZ_OUTPUT_FORMAT, TIMESTAMP_NTZ_OUTPUT_FORMAT, TIMESTAMP_OUTPUT_FORMAT, and TIMESTAMP_TZ_OUTPUT_FORMAT should all be set to something like
'YYYY-MM-DDTHH24:MI:SS.FF9TZH:TZM'
to make our lives easier. (The current default value is'YYYY-MM-DD HH24:MI:SS.FF3 TZHTZM'
, which forces me to do some custom parsing, and loses any precision past the msAll those parameters can be set at the session level, which means we should be able to set them at connection creation, but I haven't found a way to create a connection-creation hook, so I'm solving the immediate issue
🚨 User Impact 🚨
not a breaking change. We increase data fidelity for timestamp_tz columns.
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
Updating a connector
Community member or Airbyter
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.