You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/04/04 16:12:23 UTC

[GitHub] [calcite] zabetak commented on a change in pull request #1020: [CALCITE-2812] Add algebraic operators to allow expressing recursive queries (Ruben Quesada Lopez)

zabetak commented on a change in pull request #1020: [CALCITE-2812] Add algebraic operators to allow expressing recursive queries (Ruben Quesada Lopez)
URL: https://github.com/apache/calcite/pull/1020#discussion_r272256796
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableRecursiveUnion.java
 ##########
 @@ -0,0 +1,137 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.calcite.adapter.enumerable;
+
+import org.apache.calcite.linq4j.tree.BlockBuilder;
+import org.apache.calcite.linq4j.tree.DeclarationStatement;
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.calcite.linq4j.tree.ParameterExpression;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelWriter;
+import org.apache.calcite.rel.core.SetOp;
+import org.apache.calcite.rel.core.Union;
+import org.apache.calcite.schema.Table;
+import org.apache.calcite.schema.impl.TransientTable;
+import org.apache.calcite.util.BuiltInMethod;
+
+import java.util.List;
+
+
+/**
+ * Implementation of Recursive Union in
+ * {@link EnumerableConvention enumerable calling convention}.
+ */
+public class EnumerableRecursiveUnion extends Union implements EnumerableRel {
 
 Review comment:
   I like the new design but before going forward let's see what the others have to say. Just a few additional information for those following the discussion.
   
   There has been a small debate on the name of the RepeatUnion. `Iterate` and `RecursiveUnion` were the other names that were abandoned. 
   
   Although `Iterate`, initially seemed to be a nice abstraction, at the end of the day the description of what it should do was a union of the results of its inputs with the particularity that we always start from the `seedRel` and we repeatedly union the `iterativeRel`.
   
   `RecursiveUnion` also seemed nice, since it is a named also used by Postgres, and fits well with the `RECURSIVE` keyword of SQL. However, it gives the false impression that the operator does some kind of recursion which is not the case. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services