yuxiqian commented on code in PR #3826:
URL: https://github.com/apache/flink-cdc/pull/3826#discussion_r1900727807
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PostTransformOperator.java:
##########
@@ -434,23 +436,36 @@ private Optional<DataChangeEvent>
processDataChangeEvent(DataChangeEvent dataCha
&& transformProjectionOptional.get().isValid()) {
TransformProjection transformProjection =
transformProjectionOptional.get();
if (!transformProjectionProcessorMap.containsKey(
- Tuple2.of(tableId, transformProjection))
- || !transformProjectionProcessorMap
- .get(Tuple2.of(tableId,
transformProjection))
- .hasTableInfo()) {
+ Tuple2.of(tableId,
transformProjection.getProjection()))) {
transformProjectionProcessorMap.put(
- Tuple2.of(tableId, transformProjection),
+ Tuple2.of(tableId,
transformProjection.getProjection()),
TransformProjectionProcessor.of(
tableInfo,
transformProjection,
timezone,
udfDescriptors,
getUdfFunctionInstances(),
transform.getSupportedMetadataColumns()));
+ } else if (!transformProjectionProcessorMap
+ .get(Tuple2.of(tableId,
transformProjection.getProjection()))
+ .hasTableInfo()) {
Review Comment:
`hasTableInfo` could be renamed to something like `hasChangeInfo` or
`hasPostTransformChangeInfo`
##########
flink-cdc-runtime/src/main/java/org/apache/flink/cdc/runtime/operators/transform/PostTransformOperator.java:
##########
@@ -434,23 +436,36 @@ private Optional<DataChangeEvent>
processDataChangeEvent(DataChangeEvent dataCha
&& transformProjectionOptional.get().isValid()) {
TransformProjection transformProjection =
transformProjectionOptional.get();
if (!transformProjectionProcessorMap.containsKey(
- Tuple2.of(tableId, transformProjection))
- || !transformProjectionProcessorMap
- .get(Tuple2.of(tableId,
transformProjection))
- .hasTableInfo()) {
+ Tuple2.of(tableId,
transformProjection.getProjection()))) {
transformProjectionProcessorMap.put(
- Tuple2.of(tableId, transformProjection),
+ Tuple2.of(tableId,
transformProjection.getProjection()),
TransformProjectionProcessor.of(
tableInfo,
transformProjection,
timezone,
udfDescriptors,
getUdfFunctionInstances(),
transform.getSupportedMetadataColumns()));
+ } else if (!transformProjectionProcessorMap
+ .get(Tuple2.of(tableId,
transformProjection.getProjection()))
+ .hasTableInfo()) {
+ TransformProjectionProcessor
transformProjectionProcessorWithoutTableInfo =
+ transformProjectionProcessorMap.get(
+ Tuple2.of(tableId,
transformProjection.getProjection()));
+ transformProjectionProcessorMap.put(
+ Tuple2.of(tableId,
transformProjection.getProjection()),
+ TransformProjectionProcessor.of(
Review Comment:
We may have a `copy` method in `TransformProjectionProcessor` to allow us
overwriting specific field but keep others intact.
Otherwise, a lot of codes must be modified if we add one more field into it.
--
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]