Skip to content

Commit adc920b

Browse files
committed
[flink] Remove unused classes
Remove classes whose last production caller was removed by an earlier refactor, together with the tests that only covered them: - RowDataKeyAndBucketExtractor, unused since the sink switched from RowData to InternalRow. CdcRecordKeyAndBucketExtractorTest now uses FixedBucketRowKeyExtractor directly, which the removed class wrapped. - NumberSequenceRowSource, unused since aggregate push down stopped building it in BaseDataTableSource. - The legacy SinkFunction shim in paimon-flink1-common, unused since the log system code was removed.
1 parent c360abc commit adc920b

6 files changed

Lines changed: 8 additions & 819 deletions

File tree

‎paimon-flink/paimon-flink-cdc/src/test/java/org/apache/paimon/flink/sink/cdc/CdcRecordKeyAndBucketExtractorTest.java‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818

1919
package org.apache.paimon.flink.sink.cdc;
2020

21-
import org.apache.paimon.flink.sink.RowDataKeyAndBucketExtractor;
21+
import org.apache.paimon.flink.FlinkRowWrapper;
2222
import org.apache.paimon.fs.Path;
2323
import org.apache.paimon.fs.local.LocalFileIO;
2424
import org.apache.paimon.schema.FileSystemSchemaManager;
2525
import org.apache.paimon.schema.Schema;
2626
import org.apache.paimon.schema.SchemaUtils;
2727
import org.apache.paimon.schema.TableSchema;
28+
import org.apache.paimon.table.sink.FixedBucketRowKeyExtractor;
2829
import org.apache.paimon.types.DataType;
2930
import org.apache.paimon.types.DataTypes;
3031
import org.apache.paimon.types.RowKind;
@@ -65,7 +66,7 @@ public class CdcRecordKeyAndBucketExtractorTest {
6566
public void testExtract() throws Exception {
6667
ThreadLocalRandom random = ThreadLocalRandom.current();
6768
TableSchema schema = createTableSchema();
68-
RowDataKeyAndBucketExtractor expected = new RowDataKeyAndBucketExtractor(schema);
69+
FixedBucketRowKeyExtractor expected = new FixedBucketRowKeyExtractor(schema);
6970
CdcRecordKeyAndBucketExtractor actual = new CdcRecordKeyAndBucketExtractor(schema);
7071

7172
int numTests = random.nextInt(1000) + 1;
@@ -85,7 +86,7 @@ public void testExtract() throws Exception {
8586
v1,
8687
StringData.fromString(k2),
8788
StringData.fromString(v2));
88-
expected.setRecord(rowData);
89+
expected.setRecord(new FlinkRowWrapper(rowData));
8990

9091
Map<String, String> data = new HashMap<>();
9192
data.put("pt1", pt1);
@@ -109,7 +110,7 @@ public void testExtract() throws Exception {
109110
public void testNullPartition() throws Exception {
110111
ThreadLocalRandom random = ThreadLocalRandom.current();
111112
TableSchema schema = createTableSchema();
112-
RowDataKeyAndBucketExtractor expected = new RowDataKeyAndBucketExtractor(schema);
113+
FixedBucketRowKeyExtractor expected = new FixedBucketRowKeyExtractor(schema);
113114
CdcRecordKeyAndBucketExtractor actual = new CdcRecordKeyAndBucketExtractor(schema);
114115

115116
long k1 = random.nextLong();
@@ -120,7 +121,7 @@ public void testNullPartition() throws Exception {
120121
GenericRowData rowData =
121122
GenericRowData.of(
122123
null, null, k1, v1, StringData.fromString(k2), StringData.fromString(v2));
123-
expected.setRecord(rowData);
124+
expected.setRecord(new FlinkRowWrapper(rowData));
124125

125126
Map<String, String> data = new HashMap<>();
126127
data.put("pt1", null);
@@ -143,7 +144,7 @@ public void testNullPartition() throws Exception {
143144
public void testEmptyPartition() throws Exception {
144145
ThreadLocalRandom random = ThreadLocalRandom.current();
145146
TableSchema schema = createTableSchema();
146-
RowDataKeyAndBucketExtractor expected = new RowDataKeyAndBucketExtractor(schema);
147+
FixedBucketRowKeyExtractor expected = new FixedBucketRowKeyExtractor(schema);
147148
CdcRecordKeyAndBucketExtractor actual = new CdcRecordKeyAndBucketExtractor(schema);
148149

149150
long k1 = random.nextLong();
@@ -159,7 +160,7 @@ public void testEmptyPartition() throws Exception {
159160
v1,
160161
StringData.fromString(k2),
161162
StringData.fromString(v2));
162-
expected.setRecord(rowData);
163+
expected.setRecord(new FlinkRowWrapper(rowData));
163164

164165
Map<String, String> data = new HashMap<>();
165166
data.put("pt1", "");

‎paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/RowDataKeyAndBucketExtractor.java‎

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)