Closed
Description
Is your feature request related to a problem or challenge?
As part of #462, @matthewgapp implemented support for recursive Common Table Expressions (aka Recursive CTEs)
Here is an example of such a query:
At the moment, to use recursive CTEs you must enable a config option:
set datafusion.execution.enable_recursive_ctes = true;
Describe the solution you'd like
I would like recursive CTEs to be enabled by default (and thus useable without a config option)
The only reason I know of at the moment that they are NOT enabled by default is because they might buffer an infinite amount of data (and thus exceed the total memory available to DataFusion)
Describe alternatives you've considered
I think the basic idea would be to
- Extend
RecursiveQueryExec
with aMemoryReservation
- Track the memory of any buffered batches, erroring if they can not be buffered
- Write a test in
memory_limit.rs
showing the limit being hit: https://github.com/apache/arrow-datafusion/blob/main/datafusion/core/tests/memory_limit.rs - Change the default value of
The main PR that added this feature was #8840
Additional context
No response