risinglightdb / risinglight

An educational OLAP database system.
Apache License 2.0
1.59k stars 211 forks source link

feat: support WITH clause #838

Closed wangrunji0408 closed 5 months ago

wangrunji0408 commented 5 months ago

This PR adds support for specifying CTEs using the WITH clause. We treat CTEs just as named subqueries. The implementation simply adds CTE queries to the binder context and inlines them when referenced.

However, due to an optimizer bug (which has been fixed in #796), the current CTE is pretty useless as most practice use cases will lead to panics.