yuqi1129 commented on code in PR #13548:
URL: https://github.com/apache/gravitino/pull/13548#discussion_r4235763430


##########
catalogs/catalog-jdbc-mysql/src/main/java/org/apache/gravitino/catalog/mysql/converter/MysqlTypeConverter.java:
##########
@@ -166,4 +168,19 @@ public String fromGravitino(Type type) {
     throw new IllegalArgumentException(
         String.format("Couldn't convert Gravitino type %s to MySQL type", 
type.simpleString()));
   }
+
+  private static Type toGravitinoDecimal(JdbcTypeBean typeBean) {
+    int precision = typeBean.getColumnSize();
+    int scale = typeBean.getScale();
+    if (precision <= MAX_DECIMAL_PRECISION) {
+      return Types.DecimalType.of(precision, scale);
+    }
+
+    // MySQL supports precision up to 65, while Gravitino DecimalType is 
limited to 38.
+    // Preserve larger decimals as ExternalType so loading the table does not 
fail.
+    String unsignedSuffix =
+        DECIMAL_UNSIGNED.equalsIgnoreCase(typeBean.getTypeName()) ? " 
unsigned" : "";

Review Comment:
   OK, it looks good to me. 



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