peter-toth opened a new pull request #23531: [SPARK-24497][SQL] Support recursive SQL query URL: https://github.com/apache/spark/pull/23531 ## What changes were proposed in this pull request? This PR adds recursion to Spark SQL. A recursive query is defined using the `WITH RECURSIVE` keywords and referring the name of the common table expression within the query. The query has to follow the following rules: - A query is made of one or more anchor and one or more recursive terms. - An anchor terms doesn't contain self reference and it is used to initialize the query. - A recursive term contains a self reference and it is used to expand the current set of rows with new ones. - Anchor and recursive terms must be joined with each other by `UNION ALL` operators. - New rows can only be derived from the newly added rows of the previous iteration (or from the initial set of rows of anchor terms). This limitation implies that recursive references can't be used with some of the joins, aggregations or subqueries. Please see `recursion.sql` for some examples. ## How was this patch tested? Added new tests in `recursion.sql`
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
