dbt-labs / dbt-labs/dbt

[v2 Bug] [Snowflake] LogicalPlanError (dbt1019) during `--write-index` for columns depending on `sysdate()`

Open
#15,232 0 comments 0 reactions 1 assignee Claimed by @jasonlin45 View on GitHub
adapter:snowflake area:wizard engine:v2 status:triage type:bug
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

### Is this a new bug in dbt v2.x compared to the latest version of dbt 1.x?

- [x] I believe this is a new bug in dbt v2.x
- [x] I have searched the existing issues and could not find a duplicate

### Current Behavior

I'm running into a `LogicalPlanError (dbt1019)` error when running `dbt compile -s model --static-analysis strict --write-index` on models containing the `sysdate()` function.

### Expected Behavior

column-level lineage is written out for columns depending on `sysdate()` call

### Steps To Reproduce

1. Create a model:
```sql
-- models/model.sql
SELECT sysdate() AS d
```
2. Run `dbt compile -s model --static-analysis strict --write-index`
3. Observe compile succeeds but `dbt.column_lineage.parquet` file is not created:
```
PS > dbtf compile -s model --static-analysis strict --write-index
dbt-fusion 2.0.0-preview.186

Compiled node 'model' is:
SELECT sysdate() AS d

==================================================================== Errors and Warnings =====================================================================
[warning] [LogicalPlanError (dbt1019)]: Failed to compute lineage for model.project.model: Semantic error: 'sysdate' does not support zero arguments. Use TypeSignature::Nullary for zero arguments No function matches the given name and argument types 'sysdate()'. You might need to add explicit type casts.
Candidate functions:
sysdate()
```

### Relevant log output

```shell

```

### Environment

```markdown
- OS: Windows
- CPU: (x86 or ARM) x86
- dbt distribution and version: (`dbt --version`) Fusion preview.186
```

### Which database adapter are you using?

snowflake

### Is this a discrepancy vs. dbt 1.x?

- [ ] Yes — this works in dbt 1.x but not in dbt v2.x

### Additional Context

_No response_

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.