Skip to content

Commit

Permalink
Update to convert metric nodes to cte.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Nov 13, 2024
1 parent 23ba0da commit 96d31c1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion metricflow/plan_conversion/dataflow_to_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ def _get_nodes_to_convert_to_cte(
"""Handles logic for selecting which nodes to convert to CTEs based on the request."""
dataflow_plan = dataflow_plan_node.as_plan()
nodes_to_convert_to_cte: Set[DataflowPlanNode] = set(DataflowPlanAnalyzer.find_common_branches(dataflow_plan))
# Additional nodes will be added later.

compute_metric_nodes = DataflowPlanAnalyzer.group_nodes_by_type(dataflow_plan).compute_metric_nodes
if len(compute_metric_nodes) > 1:
nodes_to_convert_to_cte.update(compute_metric_nodes)

return frozenset(nodes_to_convert_to_cte)

Expand Down

0 comments on commit 96d31c1

Please sign in to comment.