-
Notifications
You must be signed in to change notification settings - Fork 96
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
Build DataflowPlan for custom offset window #1584
base: court/custom-offset5
Are you sure you want to change the base?
Conversation
2719954
to
2dcf124
Compare
db647f3
to
e91fd30
Compare
57ba604
to
71cef04
Compare
e91fd30
to
7e13cf3
Compare
6e642e4
to
a9dc916
Compare
d0c473a
to
bebe99d
Compare
a9dc916
to
7de2bd3
Compare
bebe99d
to
81ae325
Compare
Note that we will also implement a simpler dataflow plan if the user queries the metric with only the granularity used in the offset window. This might not be done before the initial feature release, but the results should be the same. Only differences in performance and readability.
Should only have changes to column order. Only unoptimized queries are impacted.
3740d81
to
ef1dbdc
Compare
def _offset_window_is_custom(self, offset_window: Optional[MetricTimeWindow]) -> bool: | ||
return ( | ||
offset_window is not None | ||
and offset_window.granularity in self._semantic_model_lookup.custom_granularity_names |
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.
What happens when the granularity is not in custom_granularity_names
? Is this handled through a validation?
output_node = JoinToTimeSpineNode.create( | ||
metric_source_node=output_node, | ||
time_spine_node=time_spine_node, | ||
requested_agg_time_dimension_specs=queried_agg_time_dimension_specs, | ||
join_on_time_dimension_spec=self._sort_by_base_granularity(queried_agg_time_dimension_specs)[0], | ||
offset_window=metric_spec.offset_window, | ||
offset_window=( |
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.
Are there cases where you can use a JoinToTimeSpineNode
with a custom offset window? If not, an assertion in the class would help.
This is the dataflow plan that will be used if the custom grain is queried with any grains that aren't the same as the grain used in the offset window. There will be a simpler dataflow plan used for queries using only the same grain as what's used in the offset window.