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

destination-s3-glue: Add TableType and fix race condition #22220

Merged
merged 1 commit into from
Feb 8, 2023

Conversation

blarghmatey
Copy link
Contributor

@blarghmatey blarghmatey commented Feb 1, 2023

  • The TableType attribute is not getting populated in the Glue catalog which has started to lead to errors when trying to query the table from e.g. Trino. The error message observed is Cannot invoke "String.equals(Object)" because "tableType" is null
  • There is a race condition in initializing the destination connector where a failure occurs if multiple connections attempt to initialize at the same time, because the test table that gets created is statically named. This adds a random suffix to the table to avoid that race condition.

What

Describe what the change is solving
It helps to add screenshots if it affects the frontend.

How

Describe the solution

Recommended reading order

  1. x.java
  2. y.python

🚨 User Impact 🚨

Are there any breaking changes? What is the end result perceived by the user? If yes, please merge this PR with the 🚨🚨 emoji so changelog authors can further highlight this if needed.

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

@blarghmatey
Copy link
Contributor Author

cc @itaseskii

@itaseskii
Copy link
Contributor

itaseskii commented Feb 1, 2023

/test connector=connectors/destination-s3-glue

🕑 connectors/destination-s3-glue https://github.com/airbytehq/airbyte/actions/runs/4067458942
✅ connectors/destination-s3-glue https://github.com/airbytehq/airbyte/actions/runs/4067458942
No Python unittests run

Build Passed

Test summary info:

All Passed

@blarghmatey blarghmatey force-pushed the master branch 2 times, most recently from 0ccee34 to 8cc1063 Compare February 1, 2023 19:07
@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Feb 1, 2023
@itaseskii
Copy link
Contributor

/test connector=connectors/destination-s3-glue

@blarghmatey blarghmatey force-pushed the master branch 2 times, most recently from d2dd1d9 to 455f856 Compare February 1, 2023 19:53
@itaseskii
Copy link
Contributor

/test connector=connectors/destination-s3-glue

@itaseskii
Copy link
Contributor

/test connector=connectors/destination-s3-glue

@sajarin
Copy link
Contributor

sajarin commented Feb 3, 2023

/test connector=connectors/destination-s3-glue

🕑 connectors/destination-s3-glue https://github.com/airbytehq/airbyte/actions/runs/4086083786
✅ connectors/destination-s3-glue https://github.com/airbytehq/airbyte/actions/runs/4086083786
No Python unittests run

Build Passed

Test summary info:

All Passed

@blarghmatey
Copy link
Contributor Author

Please hold on merging this. I have found a potential bug and am working on fixing it.

@blarghmatey
Copy link
Contributor Author

Nevermind, false alarm. Please proceed with merging as you are ready and able 🙂

@blarghmatey
Copy link
Contributor Author

@sajarin @itaseskii what are the next steps here? Let me know if there's anything I can help with.

@sajarin
Copy link
Contributor

sajarin commented Feb 3, 2023

@blarghmatey this looks good, the next steps here are to publish the connector and then merge it into master. I would run the action for the publishing but we have a code freeze in place until Monday so I won't be able to merge until then.

@blarghmatey
Copy link
Contributor Author

@sajarin if you are able to publish the connector that would be perfect. I'm happy to wait for the code to merge as long as I can get the connector updated. Is that possible

@blarghmatey
Copy link
Contributor Author

@sajarin can we get this released and merged today? Thanks!

@sajarin
Copy link
Contributor

sajarin commented Feb 7, 2023

/test connector=connectors/destination-s3-glue

🕑 connectors/destination-s3-glue https://github.com/airbytehq/airbyte/actions/runs/4115896229
✅ connectors/destination-s3-glue https://github.com/airbytehq/airbyte/actions/runs/4115896229
No Python unittests run

Build Passed

Test summary info:

All Passed

@sajarin
Copy link
Contributor

sajarin commented Feb 7, 2023

/publish connector=connectors/destination-s3-glue

🕑 Publishing the following connectors:
connectors/destination-s3-glue
https://github.com/airbytehq/airbyte/actions/runs/4116100405


Connector Did it publish? Were definitions generated?
connectors/destination-s3-glue

if you have connectors that successfully published but failed definition generation, follow step 4 here ▶️

@sajarin sajarin self-requested a review February 7, 2023 16:34
@sajarin
Copy link
Contributor

sajarin commented Feb 7, 2023

@blarghmatey looks like I can't push to your branch can you follow step 4 from the instructions linked above and generate the definitions by editing the destination.yaml file and running the gradle command?

We can merge once the changes are committed and pushed. Thanks for being patient.

- The TableType attribute is not getting populated in the Glue catalog which has started
to lead to errors when trying to query the table from e.g. Trino. The error message
observed is `Cannot invoke "String.equals(Object)" because "tableType" is null`
- There is a race condition in initializing the destination connector where a failure
occurs if multiple connections attempt to initialize at the same time, because the test
table that gets created is statically named. This adds a random suffix to the table to
avoid that race condition.
- The Airbyte sync ID and emitted_at fields are useful for deduplicating data. This adds
those fields to the table definition since they are already included in the records as written.
@sajarin sajarin merged commit b0a42bf into airbytehq:master Feb 8, 2023
@sajarin
Copy link
Contributor

sajarin commented Feb 8, 2023

Thanks for the PR @blarghmatey and thanks for the review @itaseskii

danidelvalle pushed a commit to danidelvalle/airbyte that referenced this pull request Feb 9, 2023
…22220)

- The TableType attribute is not getting populated in the Glue catalog which has started
to lead to errors when trying to query the table from e.g. Trino. The error message
observed is `Cannot invoke "String.equals(Object)" because "tableType" is null`
- There is a race condition in initializing the destination connector where a failure
occurs if multiple connections attempt to initialize at the same time, because the test
table that gets created is statically named. This adds a random suffix to the table to
avoid that race condition.
- The Airbyte sync ID and emitted_at fields are useful for deduplicating data. This adds
those fields to the table definition since they are already included in the records as written.
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 bounty community connectors/destination/s3-glue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants