LiebingYu commented on code in PR #2972:
URL: https://github.com/apache/fluss/pull/2972#discussion_r3056531166


##########
fluss-flink/fluss-flink-common/src/main/java/org/apache/fluss/flink/source/FlinkTableSource.java:
##########
@@ -373,7 +383,25 @@ public boolean isBounded() {
                 }
             };
         } else {
-            return SourceProvider.of(source);
+            return new DataStreamScanProvider() {
+                @Override
+                public DataStream<RowData> produceDataStream(
+                        ProviderContext providerContext, 
StreamExecutionEnvironment execEnv) {
+                    WatermarkStrategy<RowData> strategy =
+                            watermarkStrategy != null
+                                    ? watermarkStrategy
+                                    : WatermarkStrategy.noWatermarks();
+                    DataStreamSource<RowData> sourceStream =
+                            execEnv.fromSource(source, strategy, 
"FlussSource-" + tablePath);
+                    
providerContext.generateUid(FLUSS_TRANSFORMATION).ifPresent(sourceStream::uid);

Review Comment:
   After some investigation, I think this shouldn't be an issue in most Flink 
versions, except for version 2.3 and later. 
   
   In Flink `CommonExecTableSourceScan`, `SourceFunctionProvider`([line 
160](https://github.com/apache/flink/blob/ef532a23f102bd0562e7a792da38678efae410ee/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecTableSourceScan.java#L160))
 and `DataStreamScanProvider` ([line 
185](https://github.com/apache/flink/blob/ef532a23f102bd0562e7a792da38678efae410ee/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecTableSourceScan.java#L185))
 will both execute `metadata.fill(sourceTransform);`. For `legacyUidsEnabled() 
== true` (Before Flink version 2.3), the `sourceTransform` is equivalent.



-- 
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]

Reply via email to