dbt-labs / dbt-labs/dbt

info schema: add `dbt.selectors`

Open
#16,045 0 comments 0 reactions 0 assignees View on GitHub
area:engine type:feature
Dominant language
Rust
Stars
13.8k
Forks
2.6k
Avg merge
21h 31m
Merged PRs (30d)
56

Description

Follow-up from dbt-labs/fs#13498.

#15850 asks, as an open question at the end: *"Can we add a new `dbt.selectors` table to hold the metadata about selectors defined in your project?"*

Left out of the first PR because it was a question rather than a specified table, and because it is the one table in the proposal with no existing counterpart to reshape.

### Feasibility

The data is already captured and needs no change to the metadata writers: `ResolverStateRow.selectors_json` (`fs/sa/crates/dbt-metadata/src/parse_state.rs`), which lands in `parse/resolver_state.parquet`. It is simply never read by anything downstream today.

So this is a small change once the shape is agreed — a builder alongside the other assembled tables in `fs/sa/crates/dbt-index-core/src/info_schema/`, plus a `TableSpec`.

### What needs deciding

- grain: one row per selector, or one row per selector per definition clause?
- which columns: `name`, `description`, `definition` (as JSON?), `default` (whether it is the default selector)
- does the raw YAML definition get stored verbatim, or normalized?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.