Bug description
Summary
Materialized views in BigQuery are not shown in Superset's schema dropdown by default. When patched to include "MATERIALIZED VIEW"
using values from INFORMATION_SCHEMA.TABLES
, Superset does display the view — but it uses a generic "view" icon, even though the object is a materialized view, not a standard view.
This can be misleading for users, especially when differentiating performance/cost expectations in BigQuery.
Steps to Reproduce
- Create a materialized view in BigQuery (e.g.,
CREATE MATERIALIZED VIEW dev.mv_example AS ...
) - Use Superset with a BigQuery connection via SQLAlchemy URI:
bigquery://my-project?location=us-central1
- In Superset, materialized views are:
- ❌ Not listed by default
- ✅ Can be shown if manually patched in
pybigquery
to includeMATERIALIZED VIEW
- ❌ But are shown with a "view" icon, not a dedicated or "table" icon
Expected Behavior
- Superset should list materialized views by default in the schema browser
- Materialized views should have a distinct icon or at least not reuse the "view" icon
- Superset should support adding them as datasets directly through the UI dropdown
Suggested Fix
In pybigquery
:
- Ensure
_get_table_or_view_names()
includes'MATERIALIZED VIEW'
based onINFORMATION_SCHEMA.TABLES.table_type
- In Superset's UI or backend, use a different icon or label if
table_type == 'MATERIALIZED VIEW'
Environment
- Superset version: 3.0.x
- pybigquery: latest
- Deployment: GCP Compute Engine VM using ADC (Application Default Credentials)
Screenshots/recordings
Superset version
5.0.0
Python version
Not applicable
Node version
Not applicable
Browser
Firefox
Additional context
No response
Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
Hi @rmcdonough-look! I'm Dosu and I’m helping the superset team.
You're correct—Superset relies on the SQLAlchemy dialect (pybigquery) to discover schema objects, so if pybigquery doesn't include "MATERIALIZED VIEW" in its discovery logic, materialized views won't appear in the schema dropdown by default. When patched, Superset displays them, but the frontend only distinguishes between "view" and "table" types: if the type is "view", it shows a generic view icon; otherwise, it shows a table icon. There is no dedicated handling or icon for materialized views in the UI, so they're currently indistinguishable from standard views in the dropdown, which can be misleading for BigQuery users who care about performance and cost differences (source).
To fully support materialized views, both pybigquery and Superset would need updates: pybigquery should return "MATERIALIZED VIEW" as a distinct type, and the Superset frontend should map this type to a unique icon or label. There are currently no official docs, issues, or recent PRs addressing this in Superset as of July 2025.
If you need this feature now, you can patch pybigquery to include "MATERIALIZED VIEW" and, for a better UI experience, consider customizing the Superset frontend to recognize and display a distinct icon or label for this type.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other