healchow commented on code in PR #8338:
URL: https://github.com/apache/inlong/pull/8338#discussion_r1244583871


##########
inlong-sort/sort-flink/base/src/main/java/org/apache/inlong/sort/base/format/JsonDynamicSchemaFormat.java:
##########
@@ -336,6 +355,41 @@ protected RowType extractSchemaNode(JsonNode schema, 
List<String> pkNames) {
         return new RowType(fields);
     }
 
+    /**
+     * set precision and scale for decimal and other types
+     * @param type
+     * @param dialectType
+     * @return
+     */
+    public LogicalType handleDialectSqlType(LogicalType type, String 
dialectType) {
+        if (StringUtils.isBlank(dialectType)) {
+            return type;
+        }
+        if (type instanceof DecimalType) {
+            Matcher matcher = DIALECT_SQL_TYPE_PATTERN.matcher(dialectType);
+            int precision;
+            int scale;
+            DecimalType decimalType = new 
DecimalType(DecimalType.MAX_PRECISION);
+            if (matcher.matches()) {
+                String[] items = matcher.group(1).split(",");
+                precision = Integer.parseInt(items[0].trim());
+                if (precision < DecimalType.MIN_PRECISION || precision > 
DecimalType.MAX_PRECISION) {
+                    return decimalType;

Review Comment:
   The offending configuration is discarded here and should be logged.



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