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

JDBC connections to support checkpointing #24604

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

ryankfu
Copy link
Contributor

@ryankfu ryankfu commented Mar 27, 2023

What

Closes #23678

Change is only isolated to changing the functionality of table creation, record writing, and tear down process

Separate PRs will follow that rely on this change but those PRs include:

  • Removing code rot with tmpTableName no longer being used

Reason for separate PRs is to keep changes as simple as possible to review. Original changes include bloat that would be nice to haves but not functionally relevant

Affected destination connectors and tested manually (check if tables are written to and tmp tables aren't created):

  • Clickhouse
  • MSSQL ✅
  • MySQL
  • Postgres ✅
  • Exasol
  • MariaDB
  • Oracle
  • Teradata
  • TiDB

How

onStartFunction

  • removed tmp table creation
  • added table truncation for sync mode in OVERWRITE
  • added airbyte_raw table creation

recordWriterFunction

  • removed writing to tmp table
  • added writing to airbyte_raw table

onCloseFunction

  • removed insert into query
  • removed tmp table cleanup
  • removed airbyte_raw table creation (moved to onStartFunction)

Recommended reading order

  1. JdbcBufferedConsumerFactory.java
  2. StagingConsumerFactory.java

🚨 User Impact 🚨

No user breaking changes, all data will still be written to airbyte_raw table as expected, going forward this will also remove the usage of tmp table creations

For connector PRs, use this section to explain which type of semantic versioning bump occurs as a result of the changes. Refer to our Semantic Versioning for Connectors guidelines for more information. Breaking changes to connectors must be documented by an Airbyte engineer (PR author, or reviewer for community PRs) by using the Breaking Change Release Playbook.

If there are breaking changes, 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
  • Connector version is set to 0.0.1
    • Dockerfile has version 0.0.1
  • Documentation updated
    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • docs/integrations/<source or destination>/<name>.md including changelog with an entry for the initial version. 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

  • Connector version has been incremented

  • Documentation updated

    • Connector's README.md
    • Connector's bootstrap.md. See description and examples
    • Changelog updated in docs/integrations/<source or destination>/<name>.md with an entry for the new version. 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

@github-actions
Copy link
Contributor

github-actions bot commented Mar 27, 2023

Affected Connector Report

NOTE ⚠️ Changes in this PR affect the following connectors. Make sure to do the following as needed:

  • Run integration tests
  • Bump connector or module version
  • Add changelog
  • Publish the new version

✅ Sources (0)

Connector Version Changelog Publish
  • See "Actionable Items" below for how to resolve warnings and errors.

❌ Destinations (22)

Connector Version Changelog Publish
destination-azure-blob-storage 0.2.0
destination-clickhouse 0.2.3
(diff seed version)
destination-clickhouse-strict-encrypt 0.2.3 🔵
(ignored)
🔵
(ignored)
destination-databricks 1.0.0
destination-dynamodb 0.1.7
destination-exasol 0.1.1
destination-gcs 0.2.16
destination-mariadb-columnstore 0.1.7
destination-mssql 0.1.23
(diff seed version)
destination-mssql-strict-encrypt 0.1.23 🔵
(ignored)
🔵
(ignored)
destination-mysql 0.1.20
destination-mysql-strict-encrypt 0.1.21
(mismatch: 0.1.20)
🔵
(ignored)
🔵
(ignored)
destination-oracle 0.1.19
destination-oracle-strict-encrypt 0.1.19 🔵
(ignored)
🔵
(ignored)
destination-postgres 0.3.27
(diff seed version)
destination-postgres-strict-encrypt 0.3.27 🔵
(ignored)
🔵
(ignored)
destination-redshift 0.4.5
destination-rockset 0.1.4
destination-snowflake 0.4.61
destination-teradata 0.1.1
destination-tidb 0.1.1
(diff seed version)
destination-yugabytedb 0.1.1
  • See "Actionable Items" below for how to resolve warnings and errors.

👀 Other Modules (1)

  • base-normalization

Actionable Items

(click to expand)

Category Status Actionable Item
Version
mismatch
The version of the connector is different from its normal variant. Please bump the version of the connector.

doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.
Changelog
doc not found
The connector does not seem to have a documentation file. This can be normal (e.g. basic connector like source-jdbc is not published or documented). Please double-check to make sure that it is not a bug.

changelog missing
There is no chnagelog for the current version of the connector. If you are the author of the current version, please add a changelog.
Publish
not in seed
The connector is not in the seed file (e.g. source_definitions.yaml), so its publication status cannot be checked. This can be normal (e.g. some connectors are cloud-specific, and only listed in the cloud seed file). Please double-check to make sure that it is not a bug.

diff seed version
The connector exists in the seed file, but the latest version is not listed there. This usually means that the latest version is not published. Please use the /publish command to publish the latest version.

@grishick
Copy link
Contributor

grishick commented Mar 28, 2023

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/4538688580
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/4538688580
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 15      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    18      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     171     10    94%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         195     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         65     39    40%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1461    632    57%

Build Passed

Test summary info:

All Passed

@ryankfu

This comment was marked as outdated.

@ryankfu
Copy link
Contributor Author

ryankfu commented Mar 29, 2023

/test connector=connectors/destination-mysql

🕑 connectors/destination-mysql https://github.com/airbytehq/airbyte/actions/runs/4558823705
❌ connectors/destination-mysql https://github.com/airbytehq/airbyte/actions/runs/4558823705
🐛 https://gradle.com/s/zognd52jcvbp6

Build Failed

Test summary info:

Could not find result summary

@ryankfu

This comment was marked as outdated.

@ryankfu
Copy link
Contributor Author

ryankfu commented Mar 30, 2023

/test connector=connectors/destination-postgres

🕑 connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/4560254050
✅ connectors/destination-postgres https://github.com/airbytehq/airbyte/actions/runs/4560254050
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 15      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    18      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     171     10    94%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         195     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         65     39    40%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1461    632    57%

Build Passed

Test summary info:

All Passed

@ryankfu
Copy link
Contributor Author

ryankfu commented Mar 30, 2023

/test connector=connectors/destination-mssql

🕑 connectors/destination-mssql https://github.com/airbytehq/airbyte/actions/runs/4560256488
✅ connectors/destination-mssql https://github.com/airbytehq/airbyte/actions/runs/4560256488
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 15      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    18      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     171     10    94%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         195     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         65     39    40%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1461    632    57%

Build Passed

Test summary info:

All Passed

@ryankfu

This comment was marked as outdated.

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 3, 2023

/test connector=connectors/destination-oracle

🕑 connectors/destination-oracle https://github.com/airbytehq/airbyte/actions/runs/4600935762

@ryankfu ryankfu force-pushed the ryan/jdbc-consumer-factory-checkpoint branch from 695dc2f to 5ce1aaf Compare April 3, 2023 22:03
@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 3, 2023

/test connector=connectors/destination-clickhouse

🕑 connectors/destination-clickhouse https://github.com/airbytehq/airbyte/actions/runs/4601730924
✅ connectors/destination-clickhouse https://github.com/airbytehq/airbyte/actions/runs/4601730924
Python tests coverage:

Name                                                              Stmts   Miss  Cover
-------------------------------------------------------------------------------------
normalization/transform_config/__init__.py                            2      0   100%
normalization/transform_catalog/reserved_keywords.py                 15      0   100%
normalization/transform_catalog/__init__.py                           2      0   100%
normalization/destination_type.py                                    18      0   100%
normalization/__init__.py                                             4      0   100%
normalization/transform_catalog/destination_name_transformer.py     171     10    94%
normalization/transform_catalog/table_name_registry.py              174     34    80%
normalization/transform_config/transform.py                         195     48    75%
normalization/transform_catalog/utils.py                             51     14    73%
normalization/transform_catalog/dbt_macro.py                         22      7    68%
normalization/transform_catalog/catalog_processor.py                147     80    46%
normalization/transform_catalog/transform.py                         65     39    40%
normalization/transform_catalog/stream_processor.py                 595    400    33%
-------------------------------------------------------------------------------------
TOTAL                                                              1461    632    57%

Build Passed

Test summary info:

All Passed

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 4, 2023

/publish connector=connectors/destination-clickhouse run-tests=false

🕑 Publishing the following connectors:
connectors/destination-clickhouse
https://github.com/airbytehq/airbyte/actions/runs/4610762154


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

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

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 4, 2023

/publish connector=connectors/destination-postgres run-tests=false

🕑 Publishing the following connectors:
connectors/destination-postgres
https://github.com/airbytehq/airbyte/actions/runs/4610763754


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

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

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 4, 2023

/publish connector=connectors/destination-postgres-strict-encrypt run-tests=false

🕑 Publishing the following connectors:
connectors/destination-postgres-strict-encrypt
https://github.com/airbytehq/airbyte/actions/runs/4610765677


Connector Did it publish? Were definitions generated?
connectors/destination-postgres-strict-encrypt

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

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 4, 2023

/publish connector=connectors/destination-mssql run-tests=false

🕑 Publishing the following connectors:
connectors/destination-mssql
https://github.com/airbytehq/airbyte/actions/runs/4610766491


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

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

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 4, 2023

/publish connector=connectors/destination-mssql-strict-encrypt run-tests=false

🕑 Publishing the following connectors:
connectors/destination-mssql-strict-encrypt
https://github.com/airbytehq/airbyte/actions/runs/4610767745


Connector Did it publish? Were definitions generated?
connectors/destination-mssql-strict-encrypt

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

@ryankfu
Copy link
Contributor Author

ryankfu commented Apr 4, 2023

/publish connector=connectors/destination-tidb run-tests=false

🕑 Publishing the following connectors:
connectors/destination-tidb
https://github.com/airbytehq/airbyte/actions/runs/4610775467


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

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

@ryankfu ryankfu force-pushed the ryan/jdbc-consumer-factory-checkpoint branch from 117b601 to a18f9fa Compare April 5, 2023 18:10
@ryankfu ryankfu enabled auto-merge (squash) April 5, 2023 18:11
@ryankfu ryankfu merged commit 73900fa into master Apr 5, 2023
@ryankfu ryankfu deleted the ryan/jdbc-consumer-factory-checkpoint branch April 5, 2023 18:32
ryankfu added a commit that referenced this pull request Apr 5, 2023
@erohmensing erohmensing restored the ryan/jdbc-consumer-factory-checkpoint branch April 6, 2023 17:34
@erohmensing
Copy link
Contributor

erohmensing commented Apr 6, 2023

/publish connector=connectors/destination-clickhouse-strict-encrypt run-tests=false

🕑 Publishing the following connectors:
connectors/destination-clickhouse-strict-encrypt
https://github.com/airbytehq/airbyte/actions/runs/4631531679


Connector Did it publish? Were definitions generated?
connectors/destination-clickhouse-strict-encrypt

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

@erohmensing erohmensing deleted the ryan/jdbc-consumer-factory-checkpoint branch April 6, 2023 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JdbcBufferedConsumerFactory to support checkpointing
5 participants