zhangshenghang commented on issue #10343:
URL: https://github.com/apache/seatunnel/issues/10343#issuecomment-3755168987

   <!-- code-pr-reviewer -->
   Thanks for the report. This appears to be a valid bug in 
`DataValidatorTransform` when used with JDBC sink in `ROUTE_TO_TABLE` mode.
   
   **Root cause**: `DataValidatorTransform` sets 
`errorRow.setTableId(errorTable)` to a simple table name string (e.g., 
`"ffp"`), but `MultiTableSinkWriter.sinkPrimaryKeys` map keys are full 
`TableIdentifier` strings like `"catalog.database.table2"`. The mismatch causes 
`sinkPrimaryKeys.get("ffp")` to return `null`, triggering the RuntimeException.
   
   **Affected files**:
   - 
`seatunnel-transforms-v2/src/main/java/org/apache/seatunnel/transform/validator/DataValidatorTransform.java`
 (lines 140, 231)
   
   **Suggested fix**: Change `errorRow.setTableId(errorTable)` to 
`errorRow.setTableId(errorTableId.toString())` to match the full identifier 
format expected by the sink.
   
   **Workaround**: Use `FAIL` or `SKIP` validation mode instead of 
`ROUTE_TO_TABLE` until the fix is merged.


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