[ https://issues.apache.org/jira/browse/FLINK-3943?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15356180#comment-15356180 ]
ASF GitHub Bot commented on FLINK-3943: --------------------------------------- Github user fhueske commented on a diff in the pull request: https://github.com/apache/flink/pull/2169#discussion_r69047560 --- Diff: flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/plan/rules/dataSet/DataSetMinusRule.scala --- @@ -0,0 +1,64 @@ +/* + * 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.flink.api.table.plan.rules.dataSet + +import org.apache.calcite.plan.{Convention, RelOptRule, RelOptRuleCall, RelTraitSet} +import org.apache.calcite.rel.RelNode +import org.apache.calcite.rel.convert.ConverterRule +import org.apache.calcite.rel.logical.LogicalMinus +import org.apache.calcite.rel.rules.UnionToDistinctRule +import org.apache.flink.api.table.plan.nodes.dataset.{DataSetConvention, DataSetMinus} + +class DataSetMinusRule + extends ConverterRule( + classOf[LogicalMinus], + Convention.NONE, + DataSetConvention.INSTANCE, + "DataSetMinusRule") +{ + + /** + * Translate EXCEPT and EXCEPT ALL. + */ + override def matches(call: RelOptRuleCall): Boolean = { --- End diff -- This method can be removed. It always returns `true` which is the default implementation which is overwritten here. > Add support for EXCEPT (set minus) > ---------------------------------- > > Key: FLINK-3943 > URL: https://issues.apache.org/jira/browse/FLINK-3943 > Project: Flink > Issue Type: New Feature > Components: Table API & SQL > Affects Versions: 1.1.0 > Reporter: Fabian Hueske > Assignee: Ivan Mushketyk > Priority: Minor > > Currently, the Table API and SQL do not support EXCEPT. > EXCEPT can be executed as a coGroup on all fields that forwards records of > the first input if the second input is empty. > In order to add support for EXCEPT to the Table API and SQL we need to: > - Implement a {{DataSetMinus}} class that translates an EXCEPT into a DataSet > API program using a coGroup on all fields. > - Implement a {{DataSetMinusRule}} that translates a Calcite {{LogicalMinus}} > into a {{DataSetMinus}}. > - Extend the Table API (and validation phase) to provide an except() method. -- This message was sent by Atlassian JIRA (v6.3.4#6332)