Skip to content

Destination-S3: Fix AVRO-JSON Int overflow by changing to Long #14033

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

Closed
wants to merge 1 commit into from

Conversation

hbd
Copy link

@hbd hbd commented Jun 22, 2022

What

For many sources, the Schema.Type.INT type will overflow in converting JSON to AVRO. For example, Shopify IDs require a long and overflow the INT used today.

How

This PR proposes to change the INT to a LONG to fix the overflow issue.

Recommended reading order

  1. airbyte-integrations/connectors/destination-s3/src/main/java/io/airbyte/integrations/destination/s3/avro/JsonSchemaType.java

🚨 User Impact 🚨

This should not be a breaking change, since generally migrating from Int -> Long is backwards compatible (the reverse not being true).

Pre-merge Checklist

Expand the relevant checklist and delete the others.

New Connector

Community member or Airbyter

  • Community member? Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
    • docs/integrations/README.md
    • airbyte-integrations/builds.md
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the connector is published, connector added to connector index as described here
  • Seed specs have been re-generated by building the platform and committing the changes to the seed spec files, as described here
Updating a connector

Community member or Airbyter

  • Grant edit access to maintainers (instructions)
  • Secrets in the connector's spec are annotated with airbyte_secret
  • Unit & integration tests added and passing. Community members, please provide proof of success locally e.g: screenshot or copy-paste unit, integration, and acceptance test output. To run acceptance tests for a Python connector, follow instructions in the README. For java connectors run ./gradlew :airbyte-integrations:connectors:<name>:integrationTest.
  • Code reviews completed
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md including changelog. See changelog example
  • PR name follows PR naming conventions

Airbyter

If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.

  • Create a non-forked branch based on this PR and test the below items on it
  • Build is successful
  • If new credentials are required for use in CI, add them to GSM. Instructions.
  • /test connector=connectors/<name> command is passing
  • New Connector version released on Dockerhub and connector version bumped by running the /publish command described here
Connector Generator
  • Issue acceptance criteria met
  • PR name follows PR naming conventions
  • If adding a new generator, add it to the list of scaffold modules being tested
  • The generator test modules (all connectors with -scaffold in their name) have been updated with the latest scaffold by running ./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates then checking in your changes
  • Documentation which references the generator is updated as needed

Tests

Unit

Put your unit tests output here.

Integration

Put your integration tests output here.

Acceptance

Put your acceptance tests output here.

@CLAassistant
Copy link

CLAassistant commented Jun 22, 2022

CLA assistant check
All committers have signed the CLA.

@alafanechere alafanechere changed the title Fix S3 AVRO-JSON Int overflow by changing to Long Source-S3: Fix AVRO-JSON Int overflow by changing to Long Jun 23, 2022
@sajarin
Copy link
Contributor

sajarin commented Jun 23, 2022

Hi @hbd thanks for the pr. Could you sign the CLA so that we can get continue with the review process and get your change merged?

@hbd
Copy link
Author

hbd commented Jun 23, 2022

@sajarin done!

@sajarin sajarin changed the title Source-S3: Fix AVRO-JSON Int overflow by changing to Long DESTINATION-S3: Fix AVRO-JSON Int overflow by changing to Long Jun 23, 2022
@sajarin sajarin changed the title DESTINATION-S3: Fix AVRO-JSON Int overflow by changing to Long Destination-S3: Fix AVRO-JSON Int overflow by changing to Long Jun 27, 2022
@sajarin
Copy link
Contributor

sajarin commented Jun 27, 2022

Hey @hbd, looks like the change to a long type breaks some of the unit tests and so the build fails. Could you also update the unit tests?

@hbd
Copy link
Author

hbd commented Jun 30, 2022

@sajarin where are you seeing those unit tests fail? I'm seeing all workflows passing

@sajarin
Copy link
Contributor

sajarin commented Jun 30, 2022

/test connector=connectors/destination-s3

🕑 connectors/destination-s3 https://github.com/airbytehq/airbyte/actions/runs/2592001862
❌ connectors/destination-s3 https://github.com/airbytehq/airbyte/actions/runs/2592001862
🐛 https://gradle.com/s/lgxwm7nuirzgc

Build Failed

Test summary info:

Could not find result summary

@sajarin
Copy link
Contributor

sajarin commented Jun 30, 2022

@hbd can you see the failed tests in the run above now? Looks like some tests that perform some type checking are breaking as a result of the change.

@hbd
Copy link
Author

hbd commented Jul 6, 2022

@sajarin thanks for your help! I believe the PR better addresses the issue which this PR aimed to solve: #13483

The primary difference is that PR requires updating the respective schemas (for example, Shopify id field) to use big_integer instead of the integer field.

I'll close this for now, since it's better addressed as a change to the source connector schemas.

@hbd hbd closed this Jul 6, 2022
@hbd hbd deleted the hbd/s3-integer-to-long branch July 6, 2022 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

4 participants