forked from dbt-labs/metricflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update rendering to use date_trunc on base time dimension granularity
MetricFlow's initial time dimension select statement rendering was built on the assumption that the granularity configred for a given time dimension would always match the granularity of the values stored. For example, if a time dimension was defined with granularity DAY, we assumed that the values in the warehouse would always correspond to daily granularity data, and would never be offset from a day boundary. This assumption is flawed for a variety of reasons - yearly or quarterly granularities might use different offset boundaries, users may misconfigure dimensions or allow offset values into the dataset which could be safely corrected, etc. This change updates our rendering to apply the date_trunc operation on the base time dimension column, just as we do for the other, coarser granularities. The one exception is for the base granularity column for validity window time dimensions, which must retain their underlying granularity in order to remain viable as validity window boundaries for any DAILY granularity contexts, as we do not support smaller than daily granularities at this time. Note this may cause queries with start and end time constraints to no longer trigger partition pruning, an issue which will be addressed in subsequent updates.
- Loading branch information
1 parent
53cd55f
commit 21b03b7
Showing
663 changed files
with
7,386 additions
and
7,367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Fixes | ||
body: Coerce time granularity to configured value to prevent finer-grained timestamps | ||
from causing unexpected query behavior | ||
time: 2023-10-05T12:47:22.662371-07:00 | ||
custom: | ||
Author: tlento | ||
Issue: "714" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.