dbt-labs / dbt-labs/dbt-utils

Add CTE as a valid option to a star() macro

Open
#996 1 comment 0 reactions 0 assignees View on GitHub
enhancement triage
Dominant language
Makefile
Stars
1.8k
Forks
632
PR merge metrics
No merged PRs in 30d

Description

### Describe the feature
A clear and concise description of what you want to happen.
https://github.com/dbt-labs/dbt-utils/blob/main/macros/sql/star.sql
You already have a way to use CTE in generation macros like in the deduplication one

Any chance the star() macro could be extended to be used with CTE as well?
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

### Additional context
Is this feature database-specific? Which database(s) is/are relevant? Please include any other relevant context here.

### Who will this benefit?
What kind of use case will this feature be useful for? Please be specific and provide examples, this will help us prioritize properly.

### Are you interested in contributing this feature?

Contributor guide

Open the contributing guide

Research direction

Start with macros/sql/star.sql and compare its current generation options with the deduplication generation macro, which already supports CTEs. Determine the expected CTE behavior for star(), then add coverage showing that CTE input is accepted and run the relevant dbt-utils macro tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.