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

Split traversal component from DataflowToSqlQueryPlanConverter #1517

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

plypaul
Copy link
Contributor

@plypaul plypaul commented Nov 10, 2024

This PR splits off the part that does the dataflow traversal in DataflowToSqlQueryPlanConverter into a separate class to reduce the class size. Later, these two parts can be put into different files.

Copy link
Contributor

@courtneyholcomb courtneyholcomb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one recommendation about naming!

@@ -1956,3 +1923,38 @@ def visit_window_reaggregation_node(self, node: WindowReaggregationNode) -> SqlD
group_bys=outer_query_select_columns,
),
)

@staticmethod
def _make_time_range_comparison_expr(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for encapsulating this in a better way 🙏

)


class DataflowNodeToSqlSubqueryVisitor(DataflowPlanNodeVisitor[SqlDataSet]):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about the name here - it feels like removing Subquery would be more accurate (i.e., DataflowNodeToSqlVisitor), since there isn't always a subquery involved. Technically, each node resolves to a full SQL query (and the parent node often resolves to a subquery).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe DataflowNodeToDefaultSqlVisitor? Issue with DataflowNodeToSqlVisitor is differentiating this one from the new one that uses CTEs. I'll have to put renames at the end due to stack conflicts though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

Base automatically changed from p--cte--10 to main November 13, 2024 05:04
@plypaul plypaul merged commit b8523d8 into main Nov 13, 2024
15 checks passed
@plypaul plypaul deleted the p--cte--12 branch November 13, 2024 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants