dadoudouya-cpu commented on issue #10621:
URL: https://github.com/apache/seatunnel/issues/10621#issuecomment-4088586781

   > Thanks for reporting this issue. Based on the codebase analysis, the root 
cause is a **type mismatch between CDC schema inference and JSON 
serialization**.
   > 
   > **Root cause:**
   > 
   > * When using `table-pattern` for multiple tables, CDC may infer 
`SeaTunnelRowType` as `INT` based on the first table(s)
   > * For certain tables/fields, Debezium returns `String` or `BigDecimal` 
values (e.g., when `decimal.handling.mode=string`)
   > * The JSON serializer performs unchecked casts: 
`RowToJsonConverters.java:119` casts directly to `(int) value` without type 
safety checks
   > 
   > **Evidence:**
   > 
   > * 
`seatunnel-connectors-v2/connector-rabbitmq/src/main/java/org/apache/seatunnel/connectors/seatunnel/rabbitmq/sink/RabbitmqSinkWriter.java:35`
 — uses `JsonSerializationSchema`
   > * 
`seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/RowToJsonConverters.java:119`
 — unchecked `(int) value` cast
   > * 
`seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/row/SeaTunnelRowDebeziumDeserializationConverters.java:284-299`
 — CDC falls back to `String` parsing
   > 
   > **To help diagnose, could you please provide:**
   > 
   > 1. The DDL of table `saas7.s1`, especially the data type of field 
`adadadad`?
   > 2. Do multiple tables match `saas7\\..*`? Do they use different data types 
for the same field positions?
   > 3. What is your Debezium `decimal.handling.mode` setting?
   
   1、<img width="912" height="371" alt="Image" 
src="https://github.com/user-attachments/assets/5aab11f7-27c2-4ecc-8c3b-053d066f309e";
 />
   2、
   <img width="2106" height="678" alt="Image" 
src="https://github.com/user-attachments/assets/ad041728-2547-42b8-957e-decf176affb7";
 />
   
   The field types of each table in saas7 are not all the same.
   
   3、Adding <"decimal.handling.mode"=string> works for <table-names = 
"saas7.s1">, but still causes an error for <table-pattern = "saas7\\..*"  >. 
   
   <img width="696" height="609" alt="Image" 
src="https://github.com/user-attachments/assets/1b699f03-08fa-43d7-80e8-bae0b3df505e";
 />


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