Skip to content

Commit 0c77120

Browse files
authored
[flink] FlinkSink implements SupportsPreWriteTopology instead of WithPreWriteTopology (#695)
1 parent 425226a commit 0c77120

3 files changed

Lines changed: 30 additions & 8 deletions

File tree

fluss-flink/fluss-flink-1.18/pom.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,13 @@
6969
<scope>provided</scope>
7070
</dependency>
7171

72+
<dependency>
73+
<groupId>org.apache.flink</groupId>
74+
<artifactId>flink-streaming-java</artifactId>
75+
<version>${flink.minor.version}</version>
76+
<scope>provided</scope>
77+
</dependency>
78+
7279
<!-- test dependency -->
7380
<dependency>
7481
<groupId>com.alibaba.fluss</groupId>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2025 Alibaba Group Holding Ltd.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.apache.flink.streaming.api.connector.sink2;
18+
19+
/** Placeholder class to resolve compatibility issues. */
20+
public interface SupportsPreWriteTopology<InputT> extends WithPreWriteTopology<InputT> {}

fluss-flink/fluss-flink-common/src/main/java/com/alibaba/fluss/flink/sink/FlinkSink.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.apache.flink.api.connector.sink2.SinkWriter;
2929
import org.apache.flink.api.connector.sink2.WriterInitContext;
3030
import org.apache.flink.runtime.metrics.groups.InternalSinkWriterMetricGroup;
31-
import org.apache.flink.streaming.api.connector.sink2.WithPreWriteTopology;
31+
import org.apache.flink.streaming.api.connector.sink2.SupportsPreWriteTopology;
3232
import org.apache.flink.streaming.api.datastream.DataStream;
3333
import org.apache.flink.table.data.RowData;
3434
import org.apache.flink.table.types.logical.RowType;
@@ -42,13 +42,8 @@
4242
import static com.alibaba.fluss.flink.sink.FlinkStreamPartitioner.partition;
4343
import static com.alibaba.fluss.flink.utils.FlinkConversions.toFlussRowType;
4444

45-
/**
46-
* Flink sink for Fluss.
47-
*
48-
* <p>TODO: WithPreWriteTopology need to be changed to supportsPreWriteTopology in Flink 1.20. Trace
49-
* by https://github.com/alibaba/fluss/issues/622.
50-
*/
51-
class FlinkSink implements Sink<RowData>, WithPreWriteTopology<RowData> {
45+
/** Flink sink for Fluss. */
46+
class FlinkSink implements Sink<RowData>, SupportsPreWriteTopology<RowData> {
5247

5348
private static final long serialVersionUID = 1L;
5449

0 commit comments

Comments
 (0)