[Feature] DBT Unit tests to support Redshift limitations such as LISTAGG, MEDIAN, PERCENTILE_CONT, etc. #807
Labels
enhancement
New feature or request
unit tests
Issues related to built-in dbt unit testing functionality
Is this your first time submitting a feature request?
Describe the feature
The current DBT Unit tests feature doesn't support Redshift if the SQL in CTE contains functions such as LISTAGG, MEDIAN, PERCENTILE_CONT, etc. Those functions must be executed against a user-created-table. However, DBT combines given rows to be part of CTE, which is unsupported by Redshift. You can try SQL below.
This will error
[XX000] ERROR: One or more of the used functions must be applied on at least one user created tables. Examples of user table only functions are LISTAGG, MEDIAN, PERCENTILE_CONT, etc
But the query below works fine:
As I mentioned, if all given rows are created as temporary table first, then run the test by referring to it, it will be fine.
This is a feature request to separate DBT unit tests into 2 steps
Describe alternatives you've considered
No response
Who will this benefit?
No response
Are you interested in contributing this feature?
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: