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

Fix materialized_views filters when listing relations #353

Conversation

findepi
Copy link
Contributor

@findepi findepi commented Sep 27, 2023

Overview

Before the change, the list_relations_without_caching macro queried system.metadata.materialized_views with no effective filter on the catalog and schema name. In theory the Trino optimizer could figure out the effective predicate on the system.metadata.materialized_views table, but in practice it was not happening, and all materialized views from all catalogs where being pulled.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • README.md updated and added information about my change
  • I have run changie new to create a changelog entry

@findepi findepi force-pushed the findepi/fix-materialized-views-filters-when-listing-relations-d429c0 branch from 0589040 to 534becc Compare September 27, 2023 10:45
Copy link
Member

@mdesmet mdesmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % style remarks

dbt/include/trino/macros/adapters.sql Outdated Show resolved Hide resolved
Before the change, the `list_relations_without_caching` macro queried
`system.metadata.materialized_views` with no effective filter on the
catalog and schema name. In theory the Trino optimizer could figure out
the effective predicate on the `system.metadata.materialized_views`
table, but in practice it was not happening, and all materialized views
from all catalogs where being pulled.
@findepi findepi force-pushed the findepi/fix-materialized-views-filters-when-listing-relations-d429c0 branch from 534becc to a0be1c4 Compare September 28, 2023 08:57
@hovaesco hovaesco merged commit 6d4cc2a into starburstdata:master Sep 28, 2023
8 checks passed
@findepi findepi deleted the findepi/fix-materialized-views-filters-when-listing-relations-d429c0 branch September 28, 2023 18:19
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.

4 participants