godfreyhe commented on a change in pull request #15641:
URL: https://github.com/apache/flink/pull/15641#discussion_r614721488
##########
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:
move `refactor this meta data to a utility class because it only serves
for calculating the monotonicity of some specific aggregate functions.` to
class javadoc ?
--
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]