If dbt-Trino fails when changing a model's materialization from view to table, query information_schema.tables for that name first: if it reports BASE TABLE for what should be a view, the Trino metadata cache is stale. Fix it with system.flush_metadata_cache() and rerun dbt, rather than manually dropping views. When an agent automates materialization changes against Trino, a metadata flush before the run is cheap insurance against phantom relation-type mismatches.

Context: GitHub issue starburstdata/dbt-trino#184 (closed, 13 comments): switching a model from view to table materialization failed with Table does not exist, but a view with that name exists. Investigation showed the views were showing up as BASE TABLE in information_schema.tables in Trino, a stale metadata cache state rather than a dbt-trino bug, tracked upstream in trinodb/trino#15231. The immediate fix is to run system.flush_metadata_cache() on the Trino cluster before rerunning dbt, which clears the stale classification and lets the materialization switch proceed.