Skip to content

Commit 09aac71

Browse files
committed
modify bitType value process for flink pipeline synchronize
1 parent 77bb05d commit 09aac71

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

tis-incr/tis-flink-extends/src/main/java/com/qlangtech/plugins/incr/flink/cdc/FlinkCol.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public static BiFunction Byte() {
200200
return new ByteProcess();
201201
}
202202

203+
203204
public static BiFunction DateTime() {
204205
return new DateTimeProcess();
205206
}
@@ -244,6 +245,13 @@ public Object deApply(Object o) {
244245
}
245246
}
246247

248+
public static class PipelineBooleanProcess extends ByteProcess {
249+
@Override
250+
public Object apply(Object o) {
251+
return (Boolean) (((Byte) super.apply(o)) > 0);
252+
}
253+
}
254+
247255
public static class BoolProcess extends BiFunction {
248256
@Override
249257
public Object apply(Object o) {

tis-incr/tis-realtime-flink/src/main/java/com/qlangtech/tis/plugins/incr/flink/cdc/BasicFlinkDataMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import com.qlangtech.plugins.incr.flink.cdc.FlinkCDCPipelineEventProcess.FlinkPipelineStringConvert;
2626
import com.qlangtech.plugins.incr.flink.cdc.FlinkCol;
2727
import com.qlangtech.plugins.incr.flink.cdc.FlinkCol.DTOConvertTo;
28+
import com.qlangtech.plugins.incr.flink.cdc.FlinkCol.PipelineBooleanProcess;
2829
import com.qlangtech.plugins.incr.flink.cdc.RowFieldGetterFactory;
2930
import com.qlangtech.plugins.incr.flink.cdc.RowFieldGetterFactory.ByteGetter;
3031
import com.qlangtech.tis.async.message.client.consumer.IFlinkColCreator;
@@ -271,7 +272,7 @@ public FlinkCol bitType(DataType type) {
271272
return new FlinkCol(meta, type, DataTypes.TINYINT()
272273
, FlinkCol.Byte()
273274
, FlinkCol.NoOp()
274-
, new FlinkCDCPipelineEventProcess(org.apache.flink.cdc.common.types.DataTypes.BINARY(1), FlinkCol.Byte())
275+
, new FlinkCDCPipelineEventProcess(org.apache.flink.cdc.common.types.DataTypes.BOOLEAN(), new PipelineBooleanProcess())
275276
, new ByteGetter(meta.getName(), colIndex));
276277
}
277278

0 commit comments

Comments
 (0)