YasuoStudyJava opened a new pull request, #4599:
URL: https://github.com/apache/flink-cdc/pull/4599

   ## What is the purpose of this pull request?
   
   Fixes [FLINK-41107](https://issues.apache.org/jira/browse/FLINK-41107).
   
   `HudiMetadataApplier` and `MaxComputeMetadataApplier` did not override
   `MetadataApplier#setAcceptedSchemaEvolutionTypes` / 
`#acceptsSchemaEvolutionType`, so they fell back to
   the interface defaults, which drop the configured event types and accept 
every schema change event.
   The event types resolved from `sink.include.schema.changes` / 
`sink.exclude.schema.changes`
   (and therefore `schema.change.behavior: lenient`) were silently ignored by 
both sinks:
   
   - MaxCompute still received and executed `truncate.table` / `drop.table` 
even when explicitly excluded,
     risking data loss by truncating or dropping target tables.
   - Hudi received `truncate.table` / `drop.table`, which it cannot apply, 
failing the job.
   
   With this change both appliers honor the accepted event types, consistent 
with the other pipeline
   connectors (Doris, StarRocks, Paimon, Iceberg, Kafka, Fluss).
   
   ## Brief change log
   
   - `HudiMetadataApplier`: keep the enabled schema evolution types, and 
declare only the event types it
     actually implements — `create.table`, `add.column`, `alter.column.type`, 
`drop.column`, `rename.column`.
     `truncate.table`, `drop.table` and `alter.table.comment` are reported as 
unsupported.
   - `MaxComputeMetadataApplier`: keep the enabled schema evolution types so 
events excluded by the pipeline
     configuration are no longer applied; all event types remain supported by 
default.
   - Add `HudiMetadataApplierTest#testAcceptedSchemaEvolutionTypes` and 
`MaxComputeMetadataApplierTest`
     covering default supported types and filtering after 
`setAcceptedSchemaEvolutionTypes`.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - Added unit tests in `flink-cdc-pipeline-connector-hudi` and 
`flink-cdc-pipeline-connector-maxcompute`
   - Verified locally with
     `mvn -pl 
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-maxcompute,flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-hudi
 -am 
-Dtest=MaxComputeMetadataApplierTest,HudiMetadataApplierTest#testAcceptedSchemaEvolutionTypes
 -DfailIfNoTests=false test`
   - `mvn spotless:apply` / `spotless:check` pass
   
   ## Documentation
   
   - Does this pull request introduce a new feature? no
   - If yes, how is the feature documented? not applicable — it makes the sinks 
honor already documented
     `include.schema.changes` / `exclude.schema.changes` options


-- 
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]

Reply via email to