[Feature] Add a `dimension:` node selection method
Is this your first time submitting a feature request?
- I have read the expectations for open source contributors
- I have searched the existing issues, and I could not find an existing issue for this feature
- I am requesting a straightforward extension of existing dbt functionality, rather than a Big Idea better suited to a discussion
Which version of dbt is this feature for?
Not sure / both
Describe the feature
Node selection can point at metric:, semantic_model: and saved_query:, but not at a dimension. I would like a dimension: method:
dbt ls --select "dimension:customer__country"
dbt ls --select "+dimension:order__*"It would select the semantic models that declare a matching dimension. A pattern matches the dimension name (country) or the entity-qualified name (customer__country), with the usual glob rules.
I know selection returns nodes, and a dimension is not a node. So this cannot drop a single dimension. It selects the whole semantic model, the same way metric: selects the metric node. Graph operators then work as they do today.
Describe alternatives you've considered
A tool that reuses dbt's selector syntax can add its own dimension: method. But then one selector string mixes methods dbt knows with one it doesn't, and the string stops working with dbt ls and in selectors.yml.
Who will this benefit?
Tools on the semantic layer that reuse dbt's selector syntax, and anyone who wants to find which semantic models define a dimension with dbt ls.
Are you interested in contributing this feature?
Yes
Anything else?
The data is already there. Dimensions are part of each semantic model in the manifest. Only the method is missing.
Source: dbt-labs/dbt-core