wanglijie95 commented on code in PR #23216: URL: https://github.com/apache/flink/pull/23216#discussion_r1302695113
########## flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/optimize/program/FlinkRuntimeFilterProgram.java: ########## @@ -492,11 +503,18 @@ private static RelNode tryPushDownProbeAndInjectRuntimeFilter( // we may find more cases later } - return createNewProbeWithRuntimeFilter( - ignoreExchange(buildSideInfo.buildSide), - ignoreExchange(rel), - buildSideInfo.buildIndices, - probeIndices); + if (filterHasBenefit) { + return createNewProbeWithRuntimeFilter( + ignoreExchange(buildSideInfo.buildSide), + ignoreExchange(rel), + buildSideInfo.buildIndices, + probeIndices); + } else { + // If the probe side is a direct table source, or only simple Calc, no other operations, Review Comment: Yes, test `testProbeSideIsTableSourceWithoutExchange` -- 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