Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

[AP-591] Use SHOW SCHEMAS|TABLES|COLUMNS instead of INFORMATION_SCHEMA #14

Merged
merged 6 commits into from
Mar 17, 2020

Conversation

koszti
Copy link
Collaborator

@koszti koszti commented Mar 17, 2020

Summary
This PR refactoring the code to use SHOW SCHEMAS|TABLES|COLUMNS queries instead of INFORMATION_SCHEMA. Information schema queries are slow in general and can cause failing parallel running taps with snowflake.connector.errors.ProgrammingError: 090030 (22000): Information schema query returned too much data. Please repeat query with more selective predicates.

Solution
This is in sync with the same change in pipelinewise-target-snowflake 1.6.1 at transferwise/pipelinewise-target-snowflake#67

Cons:

  • SHOW SCHEMAS|TABLES|COLUMNS returns max 10k rows.

If a SHOW query returns more than 9999 records then an exception will be raised. This is a limitation of SHOW COLUMNS but 10k rows should be enough for hundreds of average length tables. If 10k columns not enough then we can still query INFORMATION_SCHEMA as a fallback method but this is not in scope of this PR

@koszti koszti merged commit 69a1d8f into master Mar 17, 2020
@koszti koszti deleted the AP-591 branch March 17, 2020 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants