vldpyatkov commented on code in PR #13479: URL: https://github.com/apache/ignite/pull/13479#discussion_r3803614156
########## modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/logical/IgniteLogicalRecursiveStaticSpool.java: ########## @@ -0,0 +1,36 @@ +/* + * 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.ignite.internal.processors.query.calcite.rel.logical; + +import java.util.List; +import org.apache.calcite.plan.RelTraitSet; +import org.apache.calcite.rel.RelNode; +import org.apache.calcite.rel.SingleRel; + +/** Logical marker for a static recursive-term input that must be materialized on the coordinator. */ +public class IgniteLogicalRecursiveStaticSpool extends SingleRel { + /** */ + public IgniteLogicalRecursiveStaticSpool(RelNode input) { + super(input.getCluster(), input.getCluster().traitSet(), input); + } + + /** {@inheritDoc} */ + @Override public RelNode copy(RelTraitSet traitSet, List<RelNode> inputs) { + return new IgniteLogicalRecursiveStaticSpool(sole(inputs)); + } +} Review Comment: 1) IgniteLogicalRecursiveStaticSpool#copy is definitely ignoring traitSet, which formally is a contract violation. (fixed) 2) I believe that the traitSet has not to be inherited for input. Look at the Calcite class LogicalTableSpool. 3) RecursiveTableSpoolNode and TableSpoolNode are different classes. TableSpoolNode accumulates rows one time and replays them on rewind(), but RecursiveTableSpoolNode makes a new row set in each iteration. We can use TableSpoolNode for only static datasets. Look at RecursiveStaticSpoolConverterRule. It creates IgniteTableSpool, which uses TableSpoolNode. -- 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]
