geyanggang commented on code in PR #13548:
URL: https://github.com/apache/gravitino/pull/13548#discussion_r4217695828
##########
catalogs/catalog-jdbc-mysql/src/main/java/org/apache/gravitino/catalog/mysql/converter/MysqlTypeConverter.java:
##########
@@ -166,4 +167,17 @@ 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);
Review Comment:
Could you add a short comment here explaining the 38 boundary? Something
like "Gravitino's core DecimalType caps precision at 38 (128-bit fixed point),
so higher-precision MySQL decimals are preserved as ExternalType instead of
failing the load." The ClickHouse converter already does this
(ClickHouseTypeConverter, DECIMAL branch) and it's helpful for the next reader.
--
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]