Skip to content

🎉 Destination Snowflake and RedShift: Implement the Byte-buffered logic - #8869

Merged
Alexander Tsukanov (alexandertsukanov) merged 17 commits into
masterfrom
otsukanov/airbyte-8336
Dec 24, 2021
Merged

Alexander Tsukanov (alexandertsukanov) merged 17 commits into
masterfrom
otsukanov/airbyte-8336

Conversation

@alexandertsukanov

Copy link
Copy Markdown
Contributor

What

In this PR we have changed the approach how SnowFlake and Redshift destinations proceed with the staging flow (S3 and GCS). Also, was changed the approach how we calculate bytes of records. Finally, the library for counting digital information were added to make the BYTE calculations more effectively.

How

The approach was changed from record-based to buffered-based. Please, see the code comments.

Recommended reading order

  1. x.java

🚨 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/SUMMARY.md
    • 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
  • Credentials added to Github CI. 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
  • Credentials added to Github CI. Instructions.
  • /test connector=connectors/<name> command is passing.
  • New Connector version released on Dockerhub by running the /publish command described here
  • After the new connector version is published, connector version bumped in the seed directory 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

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.

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 17, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1592414367
❌ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1592414367
🐛

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 17, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-redshift

🕑 connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1592415097
❌ connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1592415097
🐛

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 17, 2021 13:26 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 17, 2021 13:26 Inactive

@edgao Edward Gao (edgao) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice! just a few small comments, otherwise looks good!

# Conflicts:
#	airbyte-integrations/connectors/destination-jdbc/src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/S3StreamCopier.java
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 20, 2021 09:09 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 20, 2021 09:11 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 20, 2021 10:03 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1601522874
❌ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1601522874
🐛

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-redshift

🕑 connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1601525041
❌ connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1601525041
🐛

@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 20, 2021 10:17 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 20, 2021 10:17 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 20, 2021 10:18 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-snowflake

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    13      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     124      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 494    313    37%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         146     32    78%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1199    501    58%

@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 20, 2021 11:31 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 20, 2021 11:32 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-redshift

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    13      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     124      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 494    313    37%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         146     32    78%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1199    501    58%

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 20, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-jdbc

🕑 connectors/destination-jdbc https://github.com/airbytehq/airbyte/actions/runs/1602546209
❌ connectors/destination-jdbc https://github.com/airbytehq/airbyte/actions/runs/1602546209
🐛

@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 22, 2021 16:32 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 22, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-jdbc

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    13      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     124      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 494    313    37%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         146     32    78%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1199    501    58%

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 22, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-snowflake

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    13      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     124      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 494    313    37%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         146     32    78%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1199    501    58%

@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 22, 2021 •

Copy link
Copy Markdown
Contributor Author

/test connector=connectors/destination-redshift

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

	 ---------- coverage: platform linux, python 3.8.10-final-0 -----------
	 Name                                                              Stmts   Miss  Cover
	 -------------------------------------------------------------------------------------
	 main_dev_transform_catalog.py                                         3      3     0%
	 main_dev_transform_config.py                                          3      3     0%
	 normalization/__init__.py                                             4      0   100%
	 normalization/destination_type.py                                    13      0   100%
	 normalization/transform_catalog/__init__.py                           2      0   100%
	 normalization/transform_catalog/catalog_processor.py                143     77    46%
	 normalization/transform_catalog/destination_name_transformer.py     124      6    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 494    313    37%
	 normalization/transform_catalog/table_name_registry.py              174     34    80%
	 normalization/transform_catalog/transform.py                         45     26    42%
	 normalization/transform_catalog/utils.py                             33      7    79%
	 normalization/transform_config/__init__.py                            2      0   100%
	 normalization/transform_config/transform.py                         146     32    78%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1199    501    58%

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 22, 2021 16:35 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 22, 2021 16:35 Inactive
@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 22, 2021 16:35 Inactive

@edgao Edward Gao (edgao) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM (assuming tests pass)

@github-actions github-actions Bot added the area/documentation Improvements or additions to documentation label Dec 23, 2021
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 23, 2021 10:04 Inactive
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 23, 2021 10:06 Inactive
@alexandertsukanov

Copy link
Copy Markdown
Contributor Author

This one will be merged after #9039 . As changes related to the same connector.

# Conflicts:
#	airbyte-integrations/connectors/destination-snowflake/Dockerfile
#	docs/integrations/destinations/snowflake.md
@alexandertsukanov
Alexander Tsukanov (alexandertsukanov) temporarily deployed to more-secrets December 24, 2021 08:24 Inactive
@alexandertsukanov

Alexander Tsukanov (alexandertsukanov) commented Dec 24, 2021 •

Copy link
Copy Markdown
Contributor Author

/publish connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1618599476
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1618599476

@jrhizor
Jared Rhizor (jrhizor) temporarily deployed to more-secrets December 24, 2021 08:35 Inactive

This branch was previously deployed

1 inactive deployment
more-secrets — 3d60b253 Deployed Dec 24, 2021 by alexandertsukanov
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.

Destination Snowflake and RedShift: Implement the Byte-buffered logic for splitting chunks

5 participants