zhangshenghang opened a new pull request, #11196:
URL: https://github.com/apache/seatunnel/pull/11196

   ### Purpose
   Fixes #10584.
   
   This PR fixes Hudi sink conversion when a SeaTunnel ROW/struct field is null.
   
   ### Root Cause
   Nested ROW fields were converted to a plain Avro record schema even though 
Hudi fields are written with null defaults. When the struct value was null, 
Avro rejected the null value/default because the field schema did not allow 
null. Recomputing per-field schemas during row conversion also bypassed the 
schema already generated for the top-level Hudi record.
   
   ### Changes
   - Keep the top-level Hudi Avro schema as a record.
   - Generate nullable Avro schemas for nested ROW fields, including ROW values 
inside arrays/maps.
   - Convert Hudi row fields using the field schema from the top-level Avro 
record.
   - Add a regression test covering both null and non-null struct field values.
   
   ### Tests
   - `./mvnw -pl seatunnel-connectors-v2/connector-hudi 
-Dtest=HudiTest#testConvertNullableStructField test`
   - `./mvnw -pl seatunnel-connectors-v2/connector-hudi -Dtest=HudiTest test`
   - `./mvnw spotless:apply`
   - `./mvnw -q -DskipTests verify`
   - `./mvnw -pl seatunnel-connectors-v2/connector-hudi test`


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