Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Compute-node only functions in Redshift like MEDIAN, etc. won't work with unit tests #5430

Closed
dbeatty10 opened this issue May 2, 2024 · 0 comments · Fixed by #5508
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.8 unit testing docs for 1.8 unit testing

Comments

@dbeatty10
Copy link
Contributor

Link to the page(s) on docs.getdbt.com requiring updates

Wherever we are documenting platform-specific caveats.

Possibly this page:
https://docs.getdbt.com/docs/build/unit-tests

Possibly this section:
https://docs.getdbt.com/docs/build/unit-tests#before-you-begin

Tell us more about this update

As noted in dbt-labs/dbt-redshift#807, certain functions in Redshift (MEDIAN, LISTAGG, etc.) don't currently work with dbt's built-in unit testing capabilities being introduced in v1.8.

The reason is that functions like MEDIAN are compute-node only functions and return an error if the query doesn't reference a user-defined table or Amazon Redshift system table.

Since dbt unit testing relies on CTE (rather than tables), models that contain any of these functions will fail with an error like:

[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

Reviewers/Stakeholders/SMEs

.

Related GitHub issues

dbt-labs/dbt-redshift#807

Additional information

See internal Slack thread here:
https://dbt-labs.slack.com/archives/C05LRDBSCNL/p1714653471861229

@dbeatty10 dbeatty10 added content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.8 unit testing docs for 1.8 unit testing labels May 2, 2024
@dbeatty10 dbeatty10 changed the title [Core] <title> [Core] Compute-node only functions in Redshift like MEDIAN, etc. won't work with unit tests May 2, 2024
matthewshaver added a commit that referenced this issue May 15, 2024
## What are you changing in this pull request and why?

Closes: #5430

## Checklist
<!--
Uncomment when publishing docs for a prerelease version of dbt:
- [ ] Add versioning components, as described in [Versioning
Docs](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-entire-pages)
- [ ] Add a note to the prerelease version [Migration
Guide](https://github.com/dbt-labs/docs.getdbt.com/tree/current/website/docs/docs/dbt-versions/core-upgrade)
-->
- [ ] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
so my content adheres to these guidelines.
- [ ] For [docs
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#about-versioning),
review how to [version a whole
page](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
and [version a block of
content](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#versioning-blocks-of-content).
- [ ] Add a checklist item for anything that needs to happen before this
PR is merged, such as "needs technical review" or "change base branch."

Adding or removing pages (delete if not applicable):
- [ ] Add/remove page in `website/sidebars.js`
- [ ] Provide a unique filename for new pages
- [ ] Add an entry for deleted pages in `website/vercel.json`
- [ ] Run link testing locally with `npm run build` to update the links
that point to deleted pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt Core The changes proposed in this issue relate to dbt Core dbt-core v1.8 unit testing docs for 1.8 unit testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants