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

   ### What changes were proposed in this pull request?
   
   Update the MySQL JDBC type converter to handle MySQL `DECIMAL` columns whose 
precision exceeds Gravitino's maximum decimal precision of 38.
   
   - Keep mapping `DECIMAL` columns with precision up to 38 to `DecimalType`.
   - Map higher-precision `DECIMAL` columns to `ExternalType`.
   - Preserve the native precision, scale, and unsigned attribute, for example:
     - `decimal(65,30)`
     - `decimal(65,30) unsigned`
   - Add tests for precision 38, precision 39, precision 65, and unsigned 
decimals.
   
   ### Why are the changes needed?
   
   MySQL supports `DECIMAL` precision up to 65, while Gravitino `DecimalType` 
only supports precision up to 38.
   
   The existing converter directly calls `Types.DecimalType.of` with the JDBC 
precision and scale. Loading a table containing `DECIMAL(65,30)` therefore 
throws:
   
   ```text
   Decimal precision must be in range[1, 38]: precision: 65
   ```
   
   The table cannot be loaded, and operations that require table loading, such 
as granting table privileges, fail as a consequence.
   
   Fix: #13547
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. MySQL tables containing `DECIMAL` columns with precision above 38 can 
now be loaded. These columns are exposed as `ExternalType` values that preserve 
their native MySQL declaration. `DECIMAL` columns with precision up to 38 are 
unchanged.
   
   ### How was this patch tested?
   
   - Added unit coverage to `TestMysqlTypeConverter`.
   - Ran:
   
     ```shell
     ./gradlew :catalogs:catalog-jdbc-mysql:test -PskipITs
     ```
   
   The MySQL JDBC catalog module tests passed.
   


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