Skip to content

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.

@camerondavison
Copy link
Author

any thoughts on this one, we have been running this code in production for a while now.

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