xuyangzhong commented on a change in pull request #17537: URL: https://github.com/apache/flink/pull/17537#discussion_r737105753
########## File path: flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecTableSourceScan.java ########## @@ -97,9 +104,40 @@ public DynamicTableSourceSpec getTableSourceSpec() { return createInputFormatTransformation(env, inputFormat, outputTypeInfo, operatorName); } else if (provider instanceof SourceProvider) { Source<RowData, ?, ?> source = ((SourceProvider) provider).createSource(); - // TODO: Push down watermark strategy to source scan - return env.fromSource( - source, WatermarkStrategy.noWatermarks(), operatorName, outputTypeInfo) + // don't use rowTypes from CatalogTable + // because the rowType number may be reduced by ProjectionPushDown + RowType sourceRowType = outputTypeInfo.toRowType(); + SourceAbilityContext sourceAbilityContext = + new SourceAbilityContext(planner.getFlinkContext(), sourceRowType); + + WatermarkStrategy<RowData> watermarkStrategy = null; + + if (tableSource instanceof SupportsWatermarkPushDown) { Review comment: In my vision, if the dynamic table source doesn't support watermarkPushdown, or can't apply the PushWatermarkIntoTableSourceScanRule, maybe we can't push the watermark down to the source. Now if the actual watermark can't be pushed into source like above situations, the WatermarkStrategy.noWatermarks() will be pushed into the source. -- 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