dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.

Home Page:https://getdbt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Support for sub-daily granularity in semantic layer configs

courtneyholcomb opened this issue · comments

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

Describe the feature

Support configuration of multiple semantic layer time spines at different granularities. This will enable support for sub-daily granularity while maintaining query efficiency, since we can default to the largest compatible time spine for a given query. YAML configs have been designed to look like this:

models:
  - name: my_time_spine
    description: "my favorite time spine"
    time_spine:
      standard_granularity_column: date_day # column for the standard grain of your table
      custom_granularities_columns: # additional custom granularites for your timespine
        - name: fiscal_year
          offset: 2
        - name: my_other_column 
          offset: 3
    columns:
      - name: date_day
        granularity: day # set granularity at column-level for standard_granularity_column

The new fields are model.time_spine and column.granularity.

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

Opened a new issue in dbt-labs/docs.getdbt.com: dbt-labs/docs.getdbt.com#5857