Auxilus08 opened a new pull request, #7995:
URL: https://github.com/apache/gravitino/pull/7995

   ### What changes were proposed in this pull request?
   
   This PR fixes the Paimon type conversion in `TypeUtils.java` to properly 
preserve nullability information for list elements and map values when 
converting from Gravitino types to Paimon types.
   
   ### Why are the changes needed?
   
   The `GravitinoToPaimonTypeVisitor` was not checking the `elementNullable()` 
and `valueNullable()` properties during type conversion, causing:
   
   - List elements to always be nullable regardless of the Gravitino type 
specification
   - Map values to always be nullable regardless of the Gravitino type 
specification
   
   This inconsistency could lead to data integrity issues and unexpected 
behavior when working with Paimon catalogs.
   
   ### Does this PR introduce any user-facing change?
   
   Yes, this change ensures that nullability constraints are properly preserved 
during type conversion, maintaining data integrity and consistency between 
Gravitino and Paimon type systems. Users will now get the correct nullability 
behavior for list elements and map values.
   
   ### How was this patch tested?
   
   Added comprehensive test coverage in `TestTypeUtils.java` with the new 
`testToPaimonTypeNullability()` method that verifies:
   
   - `Types.ListType.of(Types.IntegerType.get(), false)` converts to 
`DataTypes.ARRAY(DataTypes.INT().notNull())`
   - `Types.ListType.of(Types.IntegerType.get(), true)` converts to 
`DataTypes.ARRAY(DataTypes.INT().nullable())`
   - `Types.MapType.of(..., false)` converts to `DataTypes.MAP(..., 
DataTypes.INT().notNull())`
   - `Types.MapType.of(..., true)` converts to `DataTypes.MAP(..., 
DataTypes.INT().nullable())`
   
   All existing tests continue to pass, ensuring backward compatibility.
   
   Fixes #7983


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