snuyanzin commented on code in PR #28170:
URL: https://github.com/apache/flink/pull/28170#discussion_r3417038615


##########
flink-table/flink-table-planner/src/main/java/org/apache/calcite/rel/metadata/RelMdPredicates.java:
##########
@@ -1,1051 +0,0 @@
-/*
- * 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.metadata;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
-import org.apache.calcite.linq4j.Ord;
-import org.apache.calcite.plan.RelOptCluster;
-import org.apache.calcite.plan.RelOptPredicateList;
-import org.apache.calcite.plan.RelOptUtil;
-import org.apache.calcite.plan.RexImplicationChecker;
-import org.apache.calcite.plan.Strong;
-import org.apache.calcite.plan.volcano.RelSubset;
-import org.apache.calcite.rel.RelNode;
-import org.apache.calcite.rel.core.Aggregate;
-import org.apache.calcite.rel.core.AggregateCall;
-import org.apache.calcite.rel.core.Correlate;
-import org.apache.calcite.rel.core.Exchange;
-import org.apache.calcite.rel.core.Filter;
-import org.apache.calcite.rel.core.Intersect;
-import org.apache.calcite.rel.core.Join;
-import org.apache.calcite.rel.core.JoinRelType;
-import org.apache.calcite.rel.core.Minus;
-import org.apache.calcite.rel.core.Project;
-import org.apache.calcite.rel.core.Sample;
-import org.apache.calcite.rel.core.Sort;
-import org.apache.calcite.rel.core.TableModify;
-import org.apache.calcite.rel.core.TableScan;
-import org.apache.calcite.rel.core.Union;
-import org.apache.calcite.rel.core.Values;
-import org.apache.calcite.rex.RexBuilder;
-import org.apache.calcite.rex.RexCall;
-import org.apache.calcite.rex.RexExecutor;
-import org.apache.calcite.rex.RexInputRef;
-import org.apache.calcite.rex.RexLiteral;
-import org.apache.calcite.rex.RexNode;
-import org.apache.calcite.rex.RexPermuteInputsShuttle;
-import org.apache.calcite.rex.RexSimplify;
-import org.apache.calcite.rex.RexUnknownAs;
-import org.apache.calcite.rex.RexUtil;
-import org.apache.calcite.rex.RexVisitorImpl;
-import org.apache.calcite.sql.SqlKind;
-import org.apache.calcite.sql.fun.SqlInternalOperators;
-import org.apache.calcite.sql.fun.SqlStdOperatorTable;
-import org.apache.calcite.util.BitSets;
-import org.apache.calcite.util.Bug;
-import org.apache.calcite.util.ImmutableBitSet;
-import org.apache.calcite.util.Util;
-import org.apache.calcite.util.mapping.Mapping;
-import org.apache.calcite.util.mapping.MappingType;
-import org.apache.calcite.util.mapping.Mappings;
-import org.checkerframework.checker.nullness.qual.Nullable;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import java.util.stream.Collectors;
-
-import static java.util.Objects.requireNonNull;
-
-/**
- * Utility to infer Predicates that are applicable above a RelNode.
- *
- * <p>This is currently used by {@link
- * org.apache.calcite.rel.rules.JoinPushTransitivePredicatesRule} to infer 
<em>Predicates</em> that
- * can be inferred from one side of a Join to the other.
- *
- * <p>The PullUp Strategy is sound but not complete. Here are some of the 
limitations:
- *
- * <ol>
- *   <li>For Aggregations we only PullUp predicates that only contain Grouping 
Keys. This can be
- *       extended to infer predicates on Aggregation expressions from 
expressions on the aggregated
- *       columns. For e.g.
- *       <pre>
- * select a, max(b) from R1 where b &gt; 7
- *   &rarr; max(b) &gt; 7 or max(b) is null
- * </pre>
- *   <li>For Projections we only look at columns that are projected without 
any function applied.
- *       So:
- *       <pre>
- * select a from R1 where a &gt; 7
- *   &rarr; "a &gt; 7" is pulled up from the Projection.
- * select a + 1 from R1 where a + 1 &gt; 7
- *   &rarr; "a + 1 gt; 7" is not pulled up
- * </pre>
- *   <li>There are several restrictions on Joins:
- *       <ul>
- *         <li>We only pullUp inferred predicates for now. Pulling up existing 
predicates causes an
- *             explosion of duplicates. The existing predicates are pushed 
back down as new
- *             predicates. Once we have rules to eliminate duplicate Filter 
conditions, we should
- *             pullUp all predicates.
- *         <li>For Left Outer: we infer new predicates from the left and set 
them as applicable on
- *             the Right side. No predicates are pulledUp.
- *         <li>Right Outer Joins are handled in an analogous manner.
- *         <li>For Full Outer Joins no predicates are pulledUp or inferred.
- *       </ul>
- * </ol>
- *
- * The class contains CALCITE-6599 fix from 1.39.0, should be dropped after 
upgrade to that version

Review Comment:
   After there was found a solution to not explode plan for values, no need for 
that fix to port anymore



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