alex-plekhanov commented on a change in pull request #9009: URL: https://github.com/apache/ignite/pull/9009#discussion_r616470424
########## File path: modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/MinusNode.java ########## @@ -0,0 +1,341 @@ +/* + * 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.exec.rel; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import org.apache.calcite.rel.type.RelDataType; +import org.apache.ignite.internal.processors.query.calcite.exec.ExecutionContext; +import org.apache.ignite.internal.processors.query.calcite.exec.RowHandler; +import org.apache.ignite.internal.processors.query.calcite.exec.RowHandler.RowFactory; +import org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AggregateType; +import org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.GroupKey; +import org.apache.ignite.internal.util.typedef.F; + +/** + * Execution node for MINUS (EXCEPT) operator. + */ +public class MinusNode<Row> extends AbstractNode<Row> { Review comment: > Could you please explain why we need to process rows from select_n on MAP phase if results of `(...) EXCEPT select_3` is empty? For example, we have 'a' EXCEPT 'a' EXCEPT 'b' on node 1, and 'b' EXCEPT 'c' EXCEPT 'c' on node 2. In this case after the first step, we already have an empty set on node 1. If we stop processing other inputs on node 1, on reduce phase we will have the resulting set as 'b'. But this 'b' (from node 2) should be eliminated by the result from node 1. -- 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: [email protected]
