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

🐛 Snowflake Destination: use better file size with S3 staging files #9920

Merged
merged 21 commits into from
Feb 15, 2022

Conversation

andriikorotkov
Copy link
Contributor

@andriikorotkov andriikorotkov commented Jan 31, 2022

What

Snowflake Destination: use better file size with S3 staging files

How

Decreased the file size for snowflake S3 staging. Also added methods for closing already completed staging writers to the BufferedStreamConsumer. This will allow you not to keep unnecessary connections with staging open and save memory. The sizes of files that will be created on staging are from 120 to 140 MB - it depends on the weight of the records.

2022-02-01_11-48

2022-02-01_11-50

2022-02-01_11-50_1

2022-02-01_11-53

Recommended reading order

  1. x.java

🚨 User Impact 🚨

No impact

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.

@github-actions github-actions bot added the area/connectors Connector related issues label Jan 31, 2022
…6517-snowflake

� Conflicts:
�	airbyte-integrations/connectors/destination-jdbc/src/main/java/io/airbyte/integrations/destination/jdbc/copy/s3/S3StreamCopier.java
@andriikorotkov andriikorotkov temporarily deployed to more-secrets January 31, 2022 11:52 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Jan 31, 2022

/test connector=connectors/destination-snowflake

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

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets January 31, 2022 15:01 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 1, 2022 08:58 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 1, 2022

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1777361576
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1777361576
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     155      8    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 520    333    36%
	 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                         148     34    77%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1258    525    58%

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 1, 2022 09:14 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 1, 2022 11:18 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 2, 2022

/test connector=connectors/destination-snowflake

🕑 connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1784944921
✅ connectors/destination-snowflake https://github.com/airbytehq/airbyte/actions/runs/1784944921
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     155      8    95%
	 normalization/transform_catalog/reserved_keywords.py                 13      0   100%
	 normalization/transform_catalog/stream_processor.py                 520    333    36%
	 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                         148     34    77%
	 -------------------------------------------------------------------------------------
	 TOTAL                                                              1258    525    58%

@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 2, 2022 16:19 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 2, 2022 16:20 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 2, 2022

/test connector=connectors/destination-snowflake

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

@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 2, 2022 16:26 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 2, 2022 16:26 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 3, 2022

/test connector=connectors/destination-snowflake

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

@github-actions github-actions bot added the area/documentation Improvements or additions to documentation label Feb 11, 2022
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 11, 2022 08:56 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 11, 2022 08:57 Inactive
@edgao
Copy link
Contributor

edgao commented Feb 11, 2022

fyi a lot of connectors (including destination-snowflake) can't publish because we have broken tests right now. Working on a fix, will comment here when it's done

@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 14, 2022 08:37 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 14, 2022 08:37 Inactive
@edgao
Copy link
Contributor

edgao commented Feb 15, 2022

ok, destination-snowflake should /publish correctly now (fix was c630c9f)

…6517-snowflake

� Conflicts:
�	airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION_DEFINITION/424892c4-daac-4491-b35d-c6688ba547ba.json
�	airbyte-config/init/src/main/resources/config/STANDARD_DESTINATION_DEFINITION/f7a7d195-377f-cf5b-70a5-be6b819019dc.json
�	airbyte-config/init/src/main/resources/seed/destination_definitions.yaml
�	airbyte-config/init/src/main/resources/seed/destination_specs.yaml
�	airbyte-integrations/bases/base-java/src/main/java/io/airbyte/integrations/destination/buffered_stream_consumer/BufferedStreamConsumer.java
�	airbyte-integrations/connectors/destination-snowflake/Dockerfile
�	docs/integrations/destinations/redshift.md
�	docs/integrations/destinations/snowflake.md
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 15, 2022 10:43 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 15, 2022 10:43 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 15, 2022 10:46 Inactive
@andriikorotkov andriikorotkov temporarily deployed to more-secrets February 15, 2022 10:46 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 15, 2022

/test connector=connectors/destination-snowflake

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

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 15, 2022

/test connector=connectors/destination-redshift

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

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 15, 2022 11:34 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 15, 2022 11:35 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 15, 2022

/test connector=connectors/destination-redshift

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

Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
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                                                                   155      8    95%
normalization/transform_catalog/reserved_keywords.py                                                                               13      0   100%
normalization/transform_catalog/stream_processor.py                                                                               520    333    36%
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                                                                                       148     34    77%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                            1379    519    62%

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 15, 2022

/test connector=connectors/destination-snowflake

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

Name                                                                                                                            Stmts   Miss  Cover
---------------------------------------------------------------------------------------------------------------------------------------------------
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/__init__.py                      2      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/__init__.py               1      0   100%
/actions-runner/_work/airbyte/airbyte/airbyte-integrations/bases/airbyte-protocol/airbyte_protocol/models/airbyte_protocol.py     124      0   100%
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                                                                   155      8    95%
normalization/transform_catalog/reserved_keywords.py                                                                               13      0   100%
normalization/transform_catalog/stream_processor.py                                                                               520    333    36%
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                                                                                       148     34    77%
---------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                                                            1379    519    62%

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 15, 2022 16:54 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 15, 2022 16:54 Inactive
@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 15, 2022

/publish connector=connectors/destination-redshift

🕑 connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1848741043
✅ connectors/destination-redshift https://github.com/airbytehq/airbyte/actions/runs/1848741043

@andriikorotkov
Copy link
Contributor Author

andriikorotkov commented Feb 15, 2022

/publish connector=connectors/destination-snowflake

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

@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 15, 2022 18:34 Inactive
@octavia-squidington-iii octavia-squidington-iii temporarily deployed to more-secrets February 15, 2022 18:34 Inactive
@andriikorotkov andriikorotkov merged commit b3916c9 into master Feb 15, 2022
@andriikorotkov andriikorotkov deleted the akorotkov/6517-snowflake branch February 15, 2022 20:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Snowflake Destination: use better file size with S3 staging files
6 participants