You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/05/08 08:51:56 UTC

[GitHub] [flink] godfreyhe commented on a change in pull request #8317: [FLINK-12371] [table-planner-blink] Add support for converting (NOT) IN/ (NOT) EXISTS to SemiJoin, and generating optimized logical plan

godfreyhe commented on a change in pull request #8317: [FLINK-12371] [table-planner-blink] Add support for converting (NOT) IN/ (NOT) EXISTS to SemiJoin, and generating optimized logical plan
URL: https://github.com/apache/flink/pull/8317#discussion_r281973041
 
 

 ##########
 File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/calcite/rel/core/SemiJoin.java
 ##########
 @@ -0,0 +1,141 @@
+/*
+ * 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.rel.core;
+
+import org.apache.flink.table.plan.util.FlinkRelMdUtil;
+
+import org.apache.calcite.plan.Convention;
+import org.apache.calcite.plan.RelOptCluster;
+import org.apache.calcite.plan.RelOptCost;
+import org.apache.calcite.plan.RelOptPlanner;
+import org.apache.calcite.plan.RelTraitSet;
+import org.apache.calcite.rel.RelNode;
+import org.apache.calcite.rel.RelWriter;
+import org.apache.calcite.rel.metadata.RelMdUtil;
+import org.apache.calcite.rel.metadata.RelMetadataQuery;
+import org.apache.calcite.rel.type.RelDataType;
+import org.apache.calcite.rex.RexNode;
+import org.apache.calcite.sql.validate.SqlValidatorUtil;
+import org.apache.calcite.util.ImmutableIntList;
+import org.apache.calcite.util.Util;
+
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableSet;
+
+/*
+ * THIS FILE HAS BEEN COPIED FROM THE APACHE CALCITE PROJECT
+ * TO SUPPORT ANTI-JOIN AND NON-EQUI JOIN CONDITION.
+ */
+
+/**
+ * Relational expression that joins two relational expressions according to some
+ * condition, but outputs only columns from the left input, and eliminates
+ * duplicates.
+ *
+ * <p>The effect is something like the SQL {@code IN} operator.
+ */
+public class SemiJoin extends Join {
 
 Review comment:
   Yes, we can borrow some implementations from https://github.com/apache/calcite/pull/1157 now, and remove them after we upgrade a calcite version which contains that pr (maybe calcite 1.20). I finally find that only `Join`, `JoinRelType`, `RelDecorrelator` and some utility methods need to be copied to Flink project, and it's more clearer than before. I find some bugs and some features to improve, and have feedback to @danny0405

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