Skip to content

destination-snowflake: speed up metadata queries - #45422

Merged
Stephane Geneix (stephane-airbyte) merged 1 commit into
masterfrom
stephane/09-11-destination-snowflake_speed_up_metadata_queries
Sep 18, 2024
Merged

Stephane Geneix (stephane-airbyte) merged 1 commit into
masterfrom
stephane/09-11-destination-snowflake_speed_up_metadata_queries

Conversation

@stephane-airbyte

@stephane-airbyte Stephane Geneix (stephane-airbyte) commented Sep 12, 2024 •

Copy link
Copy Markdown
Contributor

What

This change improves the performance of metadata queries in the Snowflake destination connector by optimizing how table information is retrieved and processed.

How

  • Replaced queries to information_schema with SHOW TABLES and DESCRIBE TABLE commands for faster metadata retrieval. This should also reduce the cost for customers by reduce the use of warehouses
  • Updated methods like getFinalTableRowCount, findExistingTables, and getTable to use the new querying approach
  • Modified the V1V2 migrator to use the optimized table information retrieval

Review guide

  1. SnowflakeDestinationHandler.kt
  2. SnowflakeV1V2Migrator.kt
  3. SnowflakeInternalStagingLowercaseDatabaseTypingDedupingTest.kt

User Impact

Users should experience faster sync operations, especially for connections with a large number of tables or columns. This optimization reduces the time spent on metadata queries, leading to improved overall performance.

@vercel

vercel Bot commented Sep 12, 2024 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 9:10pm

Stephane Geneix (stephane-airbyte) commented Sep 12, 2024 •

Copy link
Copy Markdown
Contributor Author

@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from 115827f to aed93b6 Compare September 12, 2024 16:44
@octavia-squidington-iii Octavia Squidington III (octavia-squidington-iii) added the CDK Connector Development Kit label Sep 12, 2024
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from aed93b6 to c972312 Compare September 12, 2024 16:51
@stephane-airbyte
Stephane Geneix (stephane-airbyte) changed the base branch from stephane/09-10-destination-snowflake_bump_cdk to stephane/05-22-fix_destination_state_table_collation_for_snowflake September 12, 2024 16:51
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 98467d3 to dbe2fb1 Compare September 12, 2024 17:28
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch 2 times, most recently from 765a6cc to ea13c79 Compare September 12, 2024 19:37
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from dbe2fb1 to 108ff38 Compare September 12, 2024 21:38
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from ea13c79 to eb88eff Compare September 12, 2024 21:39
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from eb88eff to 36f59f1 Compare September 12, 2024 22:48
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from a67d546 to b907fb8 Compare September 16, 2024 16:40
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 5460c88 to 2a1bff1 Compare September 16, 2024 17:19
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from b907fb8 to 1c577b3 Compare September 16, 2024 17:20
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 2a1bff1 to c6ac0d4 Compare September 16, 2024 19:54
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from 1c577b3 to 32ed78a Compare September 16, 2024 19:54
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from c6ac0d4 to b57ff6a Compare September 16, 2024 20:03
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from 32ed78a to 4238cd3 Compare September 16, 2024 20:03
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from b57ff6a to 080431e Compare September 16, 2024 20:19
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from 4238cd3 to ab4981b Compare September 16, 2024 20:19
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 080431e to 005d6ab Compare September 16, 2024 20:52
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from ab4981b to 36ff551 Compare September 16, 2024 20:52
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 005d6ab to 1cc7fa1 Compare September 16, 2024 21:00
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch 3 times, most recently from 8ceef31 to d9e641e Compare September 17, 2024 01:12
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 1cc7fa1 to 34edece Compare September 17, 2024 01:23
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from d9e641e to c7beaee Compare September 17, 2024 01:23
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from 34edece to f6f5877 Compare September 17, 2024 18:18
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from c7beaee to b07ca08 Compare September 17, 2024 18:18
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from f6f5877 to e656840 Compare September 17, 2024 18:25
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from b07ca08 to e65acb4 Compare September 17, 2024 18:25
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/05-22-fix_destination_state_table_collation_for_snowflake branch from e656840 to 1a5341c Compare September 17, 2024 21:17
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from e65acb4 to afe55f2 Compare September 17, 2024 21:17
@octavia-squidington-iii Octavia Squidington III (octavia-squidington-iii) added the area/documentation Improvements or additions to documentation label Sep 17, 2024
@stephane-airbyte
Stephane Geneix (stephane-airbyte) force-pushed the stephane/09-11-destination-snowflake_speed_up_metadata_queries branch from afe55f2 to 5e9b9c1 Compare September 17, 2024 21:42

@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.

seems convincing, feels a bit risky? (lmk if you disagree, I'm not familiar with how these queries behave)

maybe worth running a prerelease image just as a failsafe? (i.e. check that the sync succeeds + doesn't trigger a soft reset)

Copy link
Copy Markdown
Contributor Author

Merge activity

This branch was successfully deployed

1 active deployment
Preview — dfd8fd1c Deployed Sep 18, 2024 by vercel[bot]
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 connectors/destination/snowflake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants