Hello Gunnar, At the moment, recursive queries are only supported via RelBuilder API, not via SQL (the documentation shows the SQL equivalent to the RelBuider code just below, but Calcite currently only supports the latter, not the former).
There is an old ticket about supporting this feature in SQL [1] , but so far no work has been done in this regard. Best regards, Ruben [1] https://issues.apache.org/jira/browse/CALCITE-129 On Tue, Feb 21, 2023 at 7:23 PM Gunnar Morling <[email protected]> wrote: > Hi, > > I'm trying to run the recursive example from the Calcite algebra docs [1], > but I'm always getting an error at the RECURSIVE keyword: > > WITH RECURSIVE aux(i) AS ( > VALUES (1) > UNION ALL > SELECT i+1 FROM aux WHERE i < 10 > ) > SELECT * FROM aux > > "Incorrect syntax near the keyword 'RECURSIVE' at line 1, column 6" > > I saw this is considered an experimental feature for the time being, is > there some flag/option I need to specify when creating my connection to > enable support for recursive queries? > > Thanks a lot for any help, > > --Gunnar > > [1] https://calcite.apache.org/docs/algebra.html#recursive-queries >
