godfreyhe commented on a change in pull request #10196: [FLINK-14789]
[table-planner-blink] extends max/min type in ColumnStats from Number to
Comparable
URL: https://github.com/apache/flink/pull/10196#discussion_r347360948
##########
File path:
flink-table/flink-table-planner-blink/src/main/scala/org/apache/flink/table/planner/plan/metadata/FlinkRelMdColumnInterval.scala
##########
@@ -66,12 +66,20 @@ class FlinkRelMdColumnInterval private extends
MetadataHandler[ColumnInterval] {
val statistic = relOptTable.getFlinkStatistic
val colStats = statistic.getColumnStats(fieldName)
if (colStats != null) {
- val min = colStats.getMinValue
- val max = colStats.getMaxValue
- if (min == null && max == null) {
- null
- } else {
+ val minValue = colStats.getMinValue
+ val maxValue = colStats.getMaxValue
+ val min = colStats.getMin
+ val max = colStats.getMax
+
+ Preconditions.checkArgument(
+ (minValue == null && maxValue == null) || (max == null && min == null))
Review comment:
the validation makes sure the values of `minValue/maxValue` and `min/max`
could be not null both.
----------------------------------------------------------------
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]
With regards,
Apache Git Services