lincoln-lil commented on a change in pull request #15641:
URL: https://github.com/apache/flink/pull/15641#discussion_r614727029



##########
File path: 
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdFilteredColumnInterval.scala
##########
@@ -67,14 +67,51 @@ class FlinkRelMdFilteredColumnInterval private extends 
MetadataHandler[FilteredC
     } else {
       val condition = project.getProjects.get(filterArg)
       checkArgument(SqlTypeUtil.inBooleanFamily(condition.getType))
-      ColumnIntervalUtil.getColumnIntervalWithFilter(
+      intersectColumnIntervalWithPredicate(
+        project.getProjects.get(columnIndex),
         Option(columnInterval),
         condition,
-        columnIndex,
         project.getCluster.getRexBuilder)
     }
   }
 
+  /**
+   * Calculate the value interval of the given column (which may carry derived 
column interval) and
+   * additional predicate expression, if the given column is a RexInputRef 
then the final interval
+   * is intersect with the predicate, if the given column is a RexLiteral then 
the final interval
+   * is the literal itself, otherwise return null.
+   * This can be improved (e.g., for RexCall) later and refactor this meta 
data to a utility class

Review comment:
       ok

##########
File path: 
flink-table/flink-table-planner-blink/src/test/scala/org/apache/flink/table/planner/plan/metadata/MetadataTestUtil.scala
##########
@@ -36,6 +36,7 @@ import org.apache.calcite.schema.Schema.TableType
 import org.apache.calcite.schema.{Schema, SchemaPlus, Table}
 import org.apache.calcite.sql.{SqlCall, SqlNode}
 
+import java.lang.{String => JString}

Review comment:
       ok




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


Reply via email to