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

[Epic] Cross-database date macro #10075

Closed
13 of 14 tasks
dbeatty10 opened this issue May 1, 2024 · 2 comments
Closed
13 of 14 tasks

[Epic] Cross-database date macro #10075

dbeatty10 opened this issue May 1, 2024 · 2 comments
Labels
stale Issues that have gone stale

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented May 1, 2024

This epic comprises the changes across dbt Labs repos necessary to implement a cross-database date macro as described in dbt-labs/dbt-adapters#192.

Implementation

There is no equivalent function specified in ISO/IEC 9075 (the SQL standard), so there is not a natural adapter-agnostic implementation from them.

However, many database vendors support a to_date function with syntax similar to the following:

to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')

So we can utilize that as the base implementation and adapters can customize as-needed.

Utility

This function is also generally useful anytime someone wants to generate SQL to create an scalar DATE value by supplying an explicit year, month, day combo.

An expected use is supplying a start and end date to dbt.date_spine.

For example, #8825 describes how we'd like to automatically create a metricflow_time_spine model if the project defines any semantic objects, and that relies upon being able to do a cross-database dbt.date_spine given an explicit start and end date.

dbt-adapters

Preview Give feedback
  1. enhancement refinement user docs
    dbeatty10
  2. cla:yes user docs

dbt-postgres

Preview Give feedback
  1. cla:yes

dbt-redshift

Preview Give feedback
  1. cla:yes

dbt-snowflake

Preview Give feedback
  1. cla:yes

dbt-bigquery

Preview Give feedback
  1. cla:yes

dbt-spark

Preview Give feedback
  1. cla:yes

Documentation

Preview Give feedback
  1. content dbt Core dbt-core v1.8 improvement
    nghi-ly
Copy link
Contributor

This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days.

@github-actions github-actions bot added the stale Issues that have gone stale label Oct 30, 2024
Copy link
Contributor

github-actions bot commented Nov 7, 2024

Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issues that have gone stale
Projects
None yet
Development

No branches or pull requests

1 participant