-
Notifications
You must be signed in to change notification settings - Fork 941
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
add data type and time zone considerations #6335
base: current
Are you sure you want to change the base?
Conversation
Adding clarifying information about time zones and data types per [internal slack thread](https://dbt-labs.slack.com/archives/C03KHQRQUBX/p1729278831684459?thread_ts=1729023422.431269&cid=C03KHQRQUBX)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
||
- Consistent data types — Both your dimension column and the time spine column should use the same data type to allow accurate comparisons. Functions like `DATE_TRUNC` don't change the data type of the input in some databases (like Snowflake). Using different data types can lead to mismatches and inaccurate results. | ||
|
||
We recommend using `DATETIME` or `TIMESTAMP` data types for your time dimensions and time spine, as they support all granularities. The `DATE` data type may not support higher granularities like hours or minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: higher
-> smaller
|
||
We recommend using `DATETIME` or `TIMESTAMP` data types for your time dimensions and time spine, as they support all granularities. The `DATE` data type may not support higher granularities like hours or minutes. | ||
|
||
- Consistent time zones — Ensure that all your time-related data uses the same time zone. MetricFlow supports UTC and currently doesn't perform any timezone manipulation. This means inconsistent time zones can cause unexpected results during aggregations and comparisons. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change this section slightly:
Time zones — MetricFlow currently doesn't perform any timezone manipulation. When working with timezone-aware data, inconsistent time zones may lead to unexpected results during aggregations and comparisons.
Reasons for the change:
- MF doesn't support UTC per se, it just ignores timezones entirely. UTC is just the most common way that people are likely to store their data for timezone consistency.
- I don't think we should ask them to ensure all their data uses the same timezone since they might have a valid reason for not doing that. We just want to warn them that there might be weird interactions in that case.
Adding clarifying information about time zones and data types per internal slack thread
🚀 Deployment available! Here are the direct links to the updated files: