dbt-labs / dbt-labs/dbt-audit-helper

The `compare_and_classify_query_results` macro doesn't work on Trino

Open
#127 1 comment 0 reactions 0 assignees View on GitHub
bug Stale triage
Dominant language
No language data
Stars
423
Forks
51
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug
When trying to use `audit_helper.compare_and_classify_query_results` on Trino database, it fails with
```
Unexpected parameters (varchar, bigint) for function count. Expected: count(), count(t) T"
```

### Steps to reproduce
1. Prepare sql definition using `audit_helper.compare_and_classify_query_results`
2. Try to call `dbt run` on that

### Expected results
That it works?

### Actual results
Fails during creating a view; view is not created.

### Screenshots and log output
```
Database Error in model my_model (models/audit_my_model.sql)
TrinoUserError(type=USER_ERROR, name=FUNCTION_NOT_FOUND, message="line 232:13: Unexpected parameters (varchar, bigint) for function count. Expected: count(), count(t) T", query_id=20251117_140555_75379_3f6y3)
```

### System information
```
packages:
- package: dbt-labs/codegen
version: 0.13.1
- package: brooklyn-data/dbt_artifacts
version: 2.9.3
- package: dbt-labs/dbt_utils
version: 1.3.1
- package: metaplane/dbt_expectations
version: 0.10.9
- package: godatadriven/dbt_date
version: 0.15.0
- package: dbt-labs/audit_helper
version: 0.12.2
```

**Which database are you using dbt with?**
- [ ] postgres
- [ ] redshift
- [ ] bigquery
- [ ] snowflake
- [x] other (specify: Trino)

**The output of `dbt --version`:**
`1.9.8`

**The operating system you're using:**
Linux

**The output of `python --version`:**
`3.11.13`

### Additional context
https://trino.io/docs/current/functions/aggregate.html#count

### Are you interested in contributing the fix?
Sure!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.