libenchao commented on code in PR #23685:
URL: https://github.com/apache/flink/pull/23685#discussion_r1400021264
##########
flink-table/flink-table-planner/src/main/scala/org/apache/flink/table/planner/plan/rules/logical/FlinkSubQueryRemoveRule.scala:
##########
@@ -216,6 +216,18 @@ class FlinkSubQueryRemoveRule(
// EXISTS and NOT EXISTS
case SqlKind.EXISTS =>
+ // If the sub-query is guaranteed to produce at least one row, just
return TRUE.
+ // If the sub-query is guaranteed to produce no rows then return FALSE.
Review Comment:
NIT, can we move the comment to it's nearest code snippet, e.g.:
```java
// If the sub-query is guaranteed to produce at least one row, just return
TRUE.
if (minRowCount != null && minRowCount >= 1d) {
return Option.apply(relBuilder.literal(!withNot))
}
// If the sub-query is guaranteed to produce no rows then return FALSE.
if (maxRowCount != null && maxRowCount < 1d) {
return Option.apply(relBuilder.literal(withNot))
}
```
--
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]