jonahgao opened a new pull request, #9836: URL: https://github.com/apache/arrow-datafusion/pull/9836
## Which issue does this PR close? Closes #9804. ## Rationale for this change If the recursive term of a CTE does not reference the CTE itself, then it should be compiled to a non-recursive CTE, otherwise it may lead to incorrect query results. This PR traverses the `LogicalPlan` of the recursive term, looking for a table scan of the work table to determine if there is a self-reference. ## What changes are included in this PR? - Move the CTE-related code to a new mod named `cte`. - Detect non-recursive CTEs in the recursive `WITH` clause. ## Are these changes tested? Yes ## Are there any user-facing changes? No -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
