tjbanghart commented on code in PR #4658:
URL: https://github.com/apache/calcite/pull/4658#discussion_r2582093403


##########
core/src/main/java/org/apache/calcite/adapter/enumerable/EnumerableCombine.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * 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.Ord;
+import org.apache.calcite.linq4j.tree.BlockBuilder;
+import org.apache.calcite.linq4j.tree.Expression;
+import org.apache.calcite.linq4j.tree.Expressions;
+import org.apache.calcite.linq4j.tree.Types;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.core.Combine;
+import org.apache.calcite.rel.type.RelDataType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/** Implementation of {@link org.apache.calcite.rel.core.Combine} in
+ * {@link org.apache.calcite.adapter.enumerable.EnumerableConvention 
enumerable calling convention}. */
+public class EnumerableCombine extends Combine implements EnumerableRel {
+  public EnumerableCombine(RelOptCluster cluster, RelTraitSet traitSet,
+      List<RelNode> inputs) {
+    super(cluster, traitSet, inputs);
+  }
+
+  @Override public EnumerableCombine copy(RelTraitSet traitSet, List<RelNode> 
inputs) {
+    return new EnumerableCombine(getCluster(), traitSet, inputs);
+  }
+
+  @Override public Result implement(EnumerableRelImplementor implementor, 
Prefer pref) {
+    final BlockBuilder builder = new BlockBuilder();
+    final RelDataType rowType = getRowType();
+    final List<Expression> fieldExpressions = new ArrayList<>();
+
+    // Implement each input and collect their results
+    // Convert each Enumerable to a List since the row type is STRUCT<QUERY_0: 
ARRAY<...>, ...>

Review Comment:
   Good idea, I will add some tests. In a branch I have quidem tests that check 
execution but the formatting is quite difficult to handle and it relies on a 
`MULTI` keyword which was hacked together. Probably best to use non-quidem 
execution tests.



-- 
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]

Reply via email to