yuxiqian commented on code in PR #3787:
URL: https://github.com/apache/flink-cdc/pull/3787#discussion_r1877866213
##########
flink-cdc-cli/src/main/java/org/apache/flink/cdc/cli/parser/YamlPipelineDefinitionParser.java:
##########
@@ -316,6 +317,10 @@ private TransformDef toTransformDef(JsonNode
transformNode) {
Optional.ofNullable(transformNode.get(TRANSFORM_DESCRIPTION_KEY))
.map(JsonNode::asText)
.orElse(null);
+ String convertDeleteAsInsert =
+
Optional.ofNullable(transformNode.get(TRANSFORM_CONVERT_DELETE_AS_INSERT_KEY))
+ .map(JsonNode::asText)
Review Comment:
We can simply call `JsonNode::asBoolean` here
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/TransformRule.java:
##########
@@ -74,4 +77,8 @@ public String getPartitionKey() {
public String getTableOption() {
return tableOption;
}
+
+ public boolean isconvertDeleteAsInsert() {
Review Comment:
```suggestion
public boolean isConvertDeleteAsInsert() {
```
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PostTransformOperator.java:
##########
@@ -448,6 +455,17 @@ private Optional<DataChangeEvent>
processDataChangeEvent(DataChangeEvent dataCha
}
}
+ private Optional<DataChangeEvent> concertDeleteAsInsert(DataChangeEvent
dataChangeEvent) {
Review Comment:
```suggestion
private Optional<DataChangeEvent> convertDeleteAsInsert(DataChangeEvent
dataChangeEvent) {
```
Typo
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PostTransformer.java:
##########
@@ -50,4 +53,8 @@ public Optional<TransformProjection> getProjection() {
public Optional<TransformFilter> getFilter() {
return filter;
}
+
+ public boolean isconvertDeleteAsInsert() {
Review Comment:
```suggestion
public boolean isConvertDeleteAsInsert() {
```
Use camelCase
##########
flink-cdc-cli/src/test/resources/definitions/pipeline-definition-full.yaml:
##########
@@ -47,6 +47,7 @@ transform:
partition-keys: product_name
table-options: comment=app order
description: project fields from source table
+ convert-delete-as-insert: true
Review Comment:
Docs in Core Concepts / Transform needs to be updated, too
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]