-
Notifications
You must be signed in to change notification settings - Fork 4
Materialize PyDough Queries as Database Views/Tables #499
Copy link
Copy link
Open
Description
Problem
PyDough queries currently produce results only at read time (to_df, to_sql). There's no way to persist an intermediate result as a table or view in the database and reuse it in subsequent queries. This is a common pattern for breaking up complex multi-step analytics.
Proposed solution
Add a pydough.to_table() function that executes a query, writes the result to the database, and returns a collection that can be used in follow-up PyDough queries.
Example:
asian_nations = nations.WHERE(region.name == 'ASIA').CALCULATE(key, name)
asian_tmp = pydough.to_table(asian_nations, name='asian_nations', replace=True)
# Use in a subsequent query
result = asian_tmp.CALCULATE(name).Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels