0dunay0 opened a new pull request, #8369:
URL: https://github.com/apache/paimon/pull/8369

   ## What does this PR do?
   
   Fixes a bug in `CdcActionCommonUtils.schemaCompatible()` where the arguments 
to `canConvert` were in the wrong order, causing valid type widenings (e.g. INT 
to BIGINT) to be rejected at job startup.
   
   `canConvert(oldType, newType, ...)` returns `CONVERT` when `oldType` can be 
widened to `newType`. The call was passing `(sourceType, paimonType)` instead 
of `(paimonType, sourceType)`, so:
   
   - `canConvert(BIGINT, INT)` returned `IGNORE` (narrowing not allowed) -> job 
failed with "schema not compatible"
   - After fix: `canConvert(INT, BIGINT)` returns `CONVERT` (valid widening) -> 
job starts correctly
   
   `applySchemaChange()` in `UpdatedDataFieldsProcessFunctionBase` already used 
the correct order. This aligns `schemaCompatible()` with that.
   
   ## Verifying this change
   
   Added `testSchemaCompatibleTypeWidening` to `SchemaEvolutionTest`:
   - asserts INT -> BIGINT is compatible (widening)
   - asserts INT -> SMALLINT is not compatible (narrowing)
   
   ## Does this PR introduce a user-facing change?
   
   Yes. Previously, restarting a Kafka sync job against an existing Paimon 
table where a column had been widened in the source (e.g. INT to BIGINT) would 
fail at startup. After this fix it starts correctly and schema evolution 
proceeds as expected.
   
   Closes #5640


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