-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add transformer for TIS, owerwrite cols for RowDataTransformerMapper
- Loading branch information
1 parent
fb0b6b9
commit f4017c2
Showing
7 changed files
with
81 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
|
||
package com.qlangtech.plugins.incr.flink.cdc; | ||
|
||
import com.qlangtech.tis.async.message.client.consumer.IFlinkColCreator; | ||
import com.qlangtech.tis.plugin.ds.IColMetaGetter; | ||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.flink.table.data.RowData; | ||
|
@@ -28,6 +29,9 @@ | |
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.time.format.DateTimeFormatter; | ||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author: 百岁([email protected]) | ||
|
@@ -61,6 +65,13 @@ public FlinkCol(IColMetaGetter meta, com.qlangtech.tis.plugin.ds.DataType colTyp | |
this(meta, colType, type, new NoOpProcess(), rowDataValGetter); | ||
} | ||
|
||
public static <T extends IColMetaGetter> List<FlinkCol> getAllTabColsMeta(List<T> colsMeta, IFlinkColCreator<FlinkCol> flinkColCreator) { | ||
final AtomicInteger colIndex = new AtomicInteger(); | ||
return colsMeta.stream() | ||
.map((c) -> flinkColCreator.build(c, colIndex.getAndIncrement())) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
public Object getRowDataVal(RowData row) { | ||
try { | ||
return rowDataValGetter.getFieldOrNull(row); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters