Skip to content

[Bug] Invalid BigQuery query when compiling with write catalog #1579

@diegoauad

Description

@diegoauad

Is this a new bug?

  • I believe this is a new bug
  • I have searched the existing issues, and I could not find an existing issue for this bug

Which packages are affected?

  • dbt-adapters
  • dbt-tests-adapter
  • dbt-athena
  • dbt-athena-community
  • dbt-bigquery
  • dbt-postgres
  • dbt-redshift
  • dbt-snowflake
  • dbt-spark

Current Behavior

When trying to parse my dbt project with the write catalog option enabled:


Expected Behavior

The command produces a catalog.json file reflecting the current data warehouse entities.

Steps To Reproduce

  1. Install dbt Fusion
  2. Initialize a project with the BigQuery adapter
  3. Add some table models
  4. Parse with --write-catalog

Relevant log output

$ dbtf parse --write-catalog -t prod

dbt-fusion 2.0.0-preview.102
   Loading profiles.yml
   Loading packages.yml
Preparing to write catalog.json

========================================================== Errors and Warnings ==========================================================
error: dbt1308: [BigQuery] googleapi: Error 400: Unrecognized name: tables at [34:34], invalidQuery (Query: https://console.cloud.google.com/bigquery?project=analytics-etl-reservation&j=bq:US:747xfCJhS4LXZy6XbqteykYtbmB&page=queryresults)
(in :2:29)
(in dbt_internal_packages/dbt-bigquery/macros/catalog/by_schema.sql:30:15)
(in dbt_internal_packages/dbt-adapters/macros/etc/statement.sql:51:11)
(in dbt_internal_packages/dbt-adapters/macros/etc/statement.sql:14:35)
  --> :2:29

=========================================================== Execution Summary ===========================================================
Finished 'parse' with 1 error for target 'prod' [31.2s]

Environment

- OS: macOS 15.7.3
- Python: Not applicable, using dbt Fusion

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage:productIn Product's queuetype:bugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions