prashantwason opened a new pull request, #18087:
URL: https://github.com/apache/hudi/pull/18087

   ### Describe the issue this Pull Request addresses
   
   This PR fixes an issue in `ParquetSchemaConverter` where complex types (MAP 
and ROW) with non-null containers but nullable elements were not correctly 
setting the repetition type for nested elements. 
   
   For example, `Array<Row<int a, string b> NOT NULL> NOT NULL` should create a 
repeated **required** group with optional elements `a` and `b` (nullable), but 
the previous implementation was passing the parent's repetition to nested 
elements instead of checking each element's nullability.
   
   ### Summary and Changelog
   
   **Summary:** Fix ParquetSchemaConverter to correctly handle nullability for 
nested elements in MAP and ROW types.
   
   **Changelog:**
   - Fix MAP case: Use `valueType.isNullable()` to determine value repetition 
instead of inheriting parent's repetition
   - Fix ROW case: Use `field.getType().isNullable()` to determine field 
repetition instead of inheriting parent's repetition  
   - Add `testConvertNestedComplexTypes()` test to verify nested complex type 
handling with mixed nullability
   - Update `testConvertComplexTypes()` to test non-null array elements
   
   ### Impact
   
   This change affects Parquet schema generation for Flink tables with complex 
nested types. Tables with non-null complex types containing nullable elements 
will now generate correct Parquet schemas with proper required/optional 
annotations.
   
   ### Risk Level
   
   Low - This is a targeted fix to the Parquet schema converter for Flink. The 
change only affects how nullability is propagated for nested types in MAP and 
ROW. The ARRAY case was already fixed previously in the codebase.
   
   ### Documentation Update
   
   None - This is a bug fix with no new configs or user-facing feature changes.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's 
guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable


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