HanumathRao commented on code in PR #3480:
URL: https://github.com/apache/calcite/pull/3480#discussion_r1370589771
##########
core/src/test/java/org/apache/calcite/test/enumerable/EnumerableRepeatUnionTest.java:
##########
@@ -45,6 +45,17 @@
*/
class EnumerableRepeatUnionTest {
+ @Test void testGenerateNumbersUsingSql() {
+ CalciteAssert.that()
+ .query("WITH RECURSIVE delta(n) AS (\n"
+ + " VALUES (1)\n"
+ + " UNION ALL\n"
Review Comment:
@mihaibudiu Thanks for reviewing the changes. I agree with @rubenada
regarding the explanation as to why this use case doesn't run into infinite
growth. I believe in general that semantics of UNION / UNION ALL are subtle in
Recursive queries.
Here is an example (again from postgresql) where usage of the union all
(http://sqlfiddle.com/#!17/9eecb/111278) will run into infinite loop but usage
of union works fine.
The infinite loop for the above example actually is because of the result
set being a multi set when union all is used.
--
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]