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

🐛 Fixing rounding of numeric values for async destinations #31083

Merged
merged 4 commits into from Oct 11, 2023

Conversation

cynthiaxyin
Copy link
Contributor

@cynthiaxyin cynthiaxyin commented Oct 4, 2023

For #28940:

  1. Platform change (airbytehq/airbyte-platform-internal#9158)
  2. Async destinations change (this PR)
  3. Non-async destinations change (will be done separately)

The order (1) and (2) are merged doesn't matter. But both of them need to be merged before the problem is fixed (for async destinations).

Problem

Previously, numeric values with many digits after the decimal point (ex: 1884518522.1684267241) would get truncated in the _airbyte_data column in the raw table (ex: 1.884518522168427e+09). We should preserve full values in the raw table (after which numeric-typed columns may have precision restrictions per destination, ex: Snowflake has ~15 digits of precision so 1884518522.16843).

Solution

Deserialize the Airbyte record message string with DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS to preserve all the decimals.

Testing

Tested with source Postgres to destination Snowflake. See old raw table, new raw table, and final table.

Reading

The main change is in AsyncStreamConsumer.java and Jsons.java, with an added unit test in AsyncStreamConsumerTest.java.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Before Merging a Connector Pull Request

Wow! 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:

  • PR name follows PR naming conventions
  • Breaking changes are considered. If a Breaking Change is being introduced, ensure an Airbyte engineer has created a Breaking Change Plan.
  • Connector version has been incremented in the Dockerfile and metadata.yaml according to our Semantic Versioning for Connectors guidelines
  • You've updated the connector's metadata.yaml file any other relevant changes, including a breakingChanges entry for major version bumps. See metadata.yaml docs
  • Secrets in the connector's spec are annotated with airbyte_secret
  • All documentation files are up to date. (README.md, bootstrap.md, docs.md, etc...)
  • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. See changelog example
  • Migration guide updated in docs/integrations/<source or destination>/<name>-migrations.md with an entry for the new version, if the version is a breaking change. See migration guide example
  • If set, you've ensured the icon is present in the platform-internal repo. (Docs)

If the checklist is complete, but the CI check is failing,

  1. Check for hidden checklists in your PR description

  2. Toggle the github label checklist-action-run on/off to re-run the checklist CI.

@vercel
Copy link

vercel bot commented Oct 4, 2023

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
airbyte-docs ⬜️ Ignored (Inspect) Visit Preview Oct 10, 2023 11:42pm

features = ['db-destinations']
useLocalCdk = false
useLocalCdk = true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please CMIIW, my understanding of the steps are:

  1. Wait for PR approval
  2. Slash publish the CDK
  3. Toggle this line (and the same for the other 2 dests) back to false
  4. Merge the PR like usual

Copy link
Contributor

Choose a reason for hiding this comment

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

looks right to me!

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

Copy link
Contributor

@edgao edgao left a comment

Choose a reason for hiding this comment

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

master cdk is already on 0.1.5 so you'll need to fix that conflict :(

we should keep an eye on this dashboard in case this causes a noticeable drop? but I'm not expecting anything egregious - :shipit:

features = ['db-destinations']
useLocalCdk = false
useLocalCdk = true
Copy link
Contributor

Choose a reason for hiding this comment

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

looks right to me!

@@ -17,7 +17,7 @@ class CdkImportTest {
*/
@Test
void cdkVersionShouldMatch() {
assertEquals("0.1.4", CDKConstants.VERSION.replace("-SNAPSHOT", ""));
assertEquals("0.1.5", CDKConstants.VERSION.replace("-SNAPSHOT", ""));
Copy link
Contributor

Choose a reason for hiding this comment

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

@aaronsteers can we delete this test class? looks like it was something for cdk dev work

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner
Copy link
Collaborator

destination-redshift test report (commit 645070c69d) - ✅

⏲️ Total pipeline duration: 20mn37s

Step Result
Build connector tar
Build destination-redshift docker image for platform(s) linux/x86_64
Java Connector Unit Tests
Build airbyte/normalization-redshift:dev
Java Connector Integration Tests
Validate metadata for destination-redshift
Connector version semver check
QA checks

🔗 View the logs here

☁️ 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=destination-redshift test

@airbyte-oss-build-runner
Copy link
Collaborator

destination-snowflake test report (commit 645070c69d) - ✅

⏲️ Total pipeline duration: 03mn22s

Step Result
Build connector tar
Build destination-snowflake docker image for platform(s) linux/x86_64
Java Connector Unit Tests
Java Connector Integration Tests
Validate metadata for destination-snowflake
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ 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=destination-snowflake test

@airbyte-oss-build-runner
Copy link
Collaborator

destination-bigquery test report (commit 645070c69d) - ✅

⏲️ Total pipeline duration: 03mn20s

Step Result
Build connector tar
Build destination-bigquery docker image for platform(s) linux/x86_64
Java Connector Unit Tests
Java Connector Integration Tests
Validate metadata for destination-bigquery
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ 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=destination-bigquery test

@cynthiaxyin
Copy link
Contributor Author

cynthiaxyin commented Oct 10, 2023

/publish-java-cdk

🕑 https://github.com/airbytehq/airbyte/actions/runs/6475890644
✅ Successfully published Java CDK version=0.1.6!

@cynthiaxyin cynthiaxyin enabled auto-merge (squash) October 10, 2023 23:43
@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner

This comment was marked as outdated.

@airbyte-oss-build-runner
Copy link
Collaborator

destination-redshift test report (commit 1059004942) - ✅

⏲️ Total pipeline duration: 03mn32s

Step Result
Build connector tar
Build destination-redshift docker image for platform(s) linux/x86_64
Java Connector Unit Tests
Build airbyte/normalization-redshift:dev
Java Connector Integration Tests
Validate metadata for destination-redshift
Connector version semver check
QA checks

🔗 View the logs here

☁️ 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=destination-redshift test

@airbyte-oss-build-runner
Copy link
Collaborator

destination-bigquery test report (commit 1059004942) - ✅

⏲️ Total pipeline duration: 03mn10s

Step Result
Build connector tar
Build destination-bigquery docker image for platform(s) linux/x86_64
Java Connector Unit Tests
Java Connector Integration Tests
Validate metadata for destination-bigquery
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ 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=destination-bigquery test

@airbyte-oss-build-runner
Copy link
Collaborator

destination-snowflake test report (commit 1059004942) - ✅

⏲️ Total pipeline duration: 11mn06s

Step Result
Build connector tar
Build destination-snowflake docker image for platform(s) linux/x86_64
Java Connector Unit Tests
Java Connector Integration Tests
Validate metadata for destination-snowflake
Connector version semver check
Connector version increment check
QA checks

🔗 View the logs here

☁️ 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=destination-snowflake test

@cynthiaxyin cynthiaxyin merged commit e3d126b into master Oct 11, 2023
23 checks passed
@cynthiaxyin cynthiaxyin deleted the cynthia/numeric_rounding branch October 11, 2023 02:13
ariesgun pushed a commit to ariesgun/airbyte that referenced this pull request Oct 20, 2023
ariesgun pushed a commit to ariesgun/airbyte that referenced this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants