ibis icon indicating copy to clipboard operation
ibis copied to clipboard

feat(api): Add support for Recursive Common Table Expressions (CTE's)

Open prmoore77 opened this issue 3 years ago • 1 comments

Please add support for Recursive CTE's in Ibis as a way to interact with hierarchical data using Python.

Please see repo: https://github.com/prmoore77/ibis-olap-aggregation - for an example where we use Recursive CTEs to manually create table structures that allow aggregation of fact data along a dimensional hierarchy.

This can help with Business Intelligence workloads in Ibis that need to aggregate data hierarchically. The business problem (and solving SQL) is detailed in this medium article.

Thank you!

prmoore77 avatar Jun 22 '22 20:06 prmoore77

If it helps - I converted the "HierarchyDimension" class to now use SQLAlchemy Core for the Recursive CTE (per suggestion from @cpcloud) - see: https://github.com/prmoore77/ibis-olap-aggregation/blob/main/classes/hierarchy_dimension_table.py

This may help for the ibis api feature...

prmoore77 avatar Aug 05 '22 15:08 prmoore77

Closing this out for now. This is an interesting idea, but it needs some API design work.

cpcloud avatar Oct 11 '23 10:10 cpcloud