starburstdata/dbt-trino

Table 'system.metadata.materialized_view' does not exist error since dbt-trino 1.4.2

xerial opened this issue · 1 comments

Expected behavior

Since dbt-trino 1.4.2, the presence of system.metadata.materialized_view is required, which might not be available in an older version of Trino (e.g., 350). For supporting older versions of Trino, which have no materialized view catalogs, it's better to have a configuration option to disable checking system.metadata.materialized_view.

The error didn't happen when using dbt-trino 1.4.0.

Actual behavior

$ dbt run (some model)
16:38:35  Running with dbt=1.4.6
16:38:35  Found 50 models, 1 test, 0 snapshots, 0 analyses, 326 macros, 0 operations, 0 seed files, 0 sources, 0 exposures, 0 metrics
16:38:35
16:38:39
16:38:39  Finished running  in 0 hours 0 minutes and 3.40 seconds (3.40s).
16:38:39  Encountered an error:
Database Error
  TrinoUserError(type=USER_ERROR, name=TABLE_NOT_FOUND, message="line 11:15: Table 'system.metadata.materialized_views' does not exist", query_id=20230509_163839_39762_srmzc)

Steps To Reproduce

Use the following configuration in dbt_project.yml and connects to an older Trino (350) with dbt-trino 1.4.2 or higher.

    +materialized: incremental

Log output/Screenshots

No response

Operating System

MacOS

dbt version

1.4.6

Trino Server version

350

Python version

3.10.10

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Table system.metadata.materialized_views was added in Trino 361 (trinodb/trino#8796). The recommendation would be to upgrade the Trino version, there were many improvements in the project since then.