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

Bigquery connector: no caching for case insensitive names #10740

Open
grantatspothero opened this issue Jan 21, 2022 · 2 comments · May be fixed by #21988
Open

Bigquery connector: no caching for case insensitive names #10740

grantatspothero opened this issue Jan 21, 2022 · 2 comments · May be fixed by #21988

Comments

@grantatspothero
Copy link
Contributor

When bigquery.case-insensitive-name-matching is enabled, there is currently no caching of the mappings from case insensitive names to remote case sensitive names:
(see here for details: #10697)

This is a problem because when listing schemas/tables through trino .toRemoteDataset/.toRemoteTable are called once per schema/table respectively, resulting in a listing query for each respective schema/table.

https://github.com/trinodb/trino/blob/master/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java#L128
https://github.com/trinodb/trino/blob/master/plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java#L176-L179

This is likely the root cause of slow metadata listing in this issue: #4580

@grantatspothero
Copy link
Contributor Author

grantatspothero commented Jan 21, 2022

Started down the path of implementing just a case insensitive metadata cache here: https://github.com/trinodb/trino/compare/master...grantatspothero:gn/bigQueryClientCacheFixes?expand=1

But a better solution would first build the general metadata cache as described here: #10741

And then use that to implement the case insensitive mapping cache.

@ebyhr
Copy link
Member

ebyhr commented Jan 22, 2022

This is likely the root cause of slow metadata listing in this issue: #4580

The issue was reported (Jul 26, 2020) before adding bigquery.case-insensitive-name-matching (Mar 5, 2021) and I could reproduce the issue without the flag.

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

Successfully merging a pull request may close this issue.

2 participants