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

Cache the columns that are found in the clickhouse table #228

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

camerondavison
Copy link

The singer sdk SQLConnector assumes that get_table_columns is a pretty quick operation because it loops over every column in the schema an calls it twice. Once for getting the type _get_column_type and once for column_exists

Roundtrip requests to clickhouse to get this information are not super fast, and tables with a large amount of columns can take a very long time to initialize.


This change caches the results of this column lookup so that we only have to inspect them once. It is possible that this operation is not safe if the sink is re-used because of meltano/sdk#2352 but given the simple use case that target clickhouse is using for this connector, this change is safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant