davidradl commented on code in PR #26155: URL: https://github.com/apache/flink/pull/26155#discussion_r1954488306
########## flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/metadata/SelectivityEstimator.scala: ########## @@ -541,7 +541,14 @@ class SelectivityEstimator(rel: RelNode, mq: FlinkRelMetadataQuery) } val columnInterval = mq.getColumnInterval(rel, inputRef.getIndex) if (columnInterval == null) { - return defaultEqualsSelectivity + // For types like VARCHAR, it has no 'interval' concept but may also contain different values. + // We utilize ndv to get a better estimate. + val ndv = mq. getDistinctRowCount(rel, ImmutableBitSet.of(inputRef.getIndex), null) Review Comment: nit: remove blank after mq. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org