dbt-labs / dbt-labs/dbt

[Bug][Fusion] `dbt lint` skeleton parser rejects BigQuery `FOR SYSTEM_TIME AS OF` (SyntaxInvalid dbt0101)

Open
#15,554 0 comments 0 reactions 0 assignees View on GitHub
triage
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

### Summary

`dbt lint` on dbt Fusion `2.0.0-preview.200` fails to parse BigQuery's `FOR SYSTEM_TIME AS OF` temporal-table clause, raising `SyntaxInvalid (dbt0101)`. The affected models are valid BigQuery that compile and run fine — only the lint skeleton parser rejects them.

### Version

dbt-fusion `2.0.0-preview.200`

### Reproduction

A model using a BigQuery temporal reference:

```sql
select ...
from {{ ref('some_source') }}
for system_time as of {{ yesterday_midnight }}
...
```

```console
$ dbt lint models/marts/fact_channel_balance_snapshots.sql --profiles-dir ../profiles --skip-semantic-manifest-validation
[error] [SyntaxInvalid (dbt0101)]: mismatched input 'for' expecting {, ';'}
--> models/marts/fact_channel_balance_snapshots.sql:27:5
```

### Expected

`FOR SYSTEM_TIME AS OF ` is valid BigQuery (time-travel / temporal tables). The skeleton parser's BigQuery grammar should accept it so these models can be linted, rather than becoming un-lintable.

### Impact

Any model using BigQuery time-travel cannot be linted. Adopting `dbt lint` in CI requires special-casing these files (e.g. downgrading parse errors to warnings) so that touching them doesn't hard-fail the build.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.