Skip to content

Commit cb7c58f

Browse files
committed
fix broken test
1 parent eb83e75 commit cb7c58f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fluss-flink/fluss-flink-common/src/test/java/com/alibaba/fluss/flink/sink/serializer/OrderSerializationSchema.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
import com.alibaba.fluss.annotation.PublicEvolving;
2020
import com.alibaba.fluss.flink.row.RowWithOp;
2121
import com.alibaba.fluss.flink.source.testutils.Order;
22+
import com.alibaba.fluss.row.BinaryString;
2223
import com.alibaba.fluss.row.GenericRow;
2324
import com.alibaba.fluss.types.RowType;
2425

2526
import org.apache.flink.table.data.RowData;
26-
import org.apache.flink.table.data.StringData;
2727
import org.apache.flink.types.RowKind;
2828

2929
/**
@@ -67,11 +67,11 @@ public void open(InitializationContext context) throws Exception {
6767
@Override
6868
public RowWithOp serialize(Order order) throws Exception {
6969
if (order == null) {
70-
return null;
70+
return new RowWithOp(null, null);
7171
}
7272

7373
// Create a new row with the same number of fields as the schema
74-
GenericRow row = new GenericRow(4);
74+
GenericRow row = new GenericRow(rowType.getFieldCount());
7575

7676
// Set order fields directly, knowing their exact position and type
7777
row.setField(0, order.getOrderId());
@@ -81,7 +81,7 @@ public RowWithOp serialize(Order order) throws Exception {
8181
// Convert String to StringData for Flink internal representation
8282
String address = order.getAddress();
8383
if (address != null) {
84-
row.setField(3, StringData.fromString(address));
84+
row.setField(3, BinaryString.fromString(address));
8585
} else {
8686
row.setField(3, null);
8787
}

0 commit comments

Comments
 (0)