You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "yunqingmoswu (via GitHub)" <gi...@apache.org> on 2023/09/01 08:57:43 UTC

[GitHub] [inlong] yunqingmoswu opened a new pull request, #8826: [INLONG-8825][Sort] Optimize the field type conversion between source and target in the whole database scenario

yunqingmoswu opened a new pull request, #8826:
URL: https://github.com/apache/inlong/pull/8826

   ### Prepare a Pull Request
   *(Change the title refer to the following example)*
   
   - Title: [INLONG-8825][Sort] Optimize the field type conversion between source and target in the whole database scenario
   
   *(The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)*
   
   - Fixes #8825 
   
   ### Motivation
   
   Optimize the field type conversion between source and target in the whole database scenario.
   
   ### Modifications
   
   - Add default length or set length according the field length from source for varchar、char  and etc.
   - Add default precision or set precision according the field precision from source for decimal.
   
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [ ] This change is a trivial rework/code cleanup without any test coverage.
   
   - [x] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a follow-up issue for adding the documentation
   


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] yunqingmoswu commented on a diff in pull request #8826: [INLONG-8825][Sort] Optimize the field type conversion between source and target in the whole database scenario

Posted by "yunqingmoswu (via GitHub)" <gi...@apache.org>.
yunqingmoswu commented on code in PR #8826:
URL: https://github.com/apache/inlong/pull/8826#discussion_r1320964395


##########
inlong-sort/sort-formats/format-json-v1.13/src/main/java/org/apache/inlong/sort/formats/json/utils/FormatJsonUtil.java:
##########
@@ -45,48 +45,27 @@
 
 public class FormatJsonUtil {
 
-    private static final int DEFAULT_DECIMAL_PRECISION = 15;
+    public static final int DEFAULT_CHAR_LENGTH = 255;
+    public static final int DEFAULT_CHAR_TIME_LENGTH = 30;
+    public static final Map<String, LogicalType> DEBEZIUM_TYPE_2_FLINK_TYPE_MAPPING =
+            ImmutableMap.<String, LogicalType>builder()
+                    .put("BOOLEAN", new BooleanType())
+                    .put("INT8", new TinyIntType())
+                    .put("INT16", new SmallIntType())
+                    .put("INT32", new IntType())
+                    .put("INT64", new BigIntType())
+                    .put("FLOAT32", new FloatType())
+                    .put("FLOAT64", new DoubleType())
+                    .put("STRING", new VarCharType())
+                    .put("BYTES", new VarBinaryType())
+                    .build();
+    private static final int DEFAULT_DECIMAL_PRECISION = 38;

Review Comment:
   done



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] EMsnap commented on a diff in pull request #8826: [INLONG-8825][Sort] Optimize the field type conversion between source and target in the whole database scenario

Posted by "EMsnap (via GitHub)" <gi...@apache.org>.
EMsnap commented on code in PR #8826:
URL: https://github.com/apache/inlong/pull/8826#discussion_r1314371150


##########
inlong-sort/sort-formats/format-json-v1.13/src/main/java/org/apache/inlong/sort/formats/json/utils/FormatJsonUtil.java:
##########
@@ -45,48 +45,27 @@
 
 public class FormatJsonUtil {
 
-    private static final int DEFAULT_DECIMAL_PRECISION = 15;
+    public static final int DEFAULT_CHAR_LENGTH = 255;
+    public static final int DEFAULT_CHAR_TIME_LENGTH = 30;
+    public static final Map<String, LogicalType> DEBEZIUM_TYPE_2_FLINK_TYPE_MAPPING =
+            ImmutableMap.<String, LogicalType>builder()
+                    .put("BOOLEAN", new BooleanType())
+                    .put("INT8", new TinyIntType())
+                    .put("INT16", new SmallIntType())
+                    .put("INT32", new IntType())
+                    .put("INT64", new BigIntType())
+                    .put("FLOAT32", new FloatType())
+                    .put("FLOAT64", new DoubleType())
+                    .put("STRING", new VarCharType())
+                    .put("BYTES", new VarBinaryType())
+                    .build();
+    private static final int DEFAULT_DECIMAL_PRECISION = 38;

Review Comment:
   duplicate in JsonDynamicSchemaFormat



##########
inlong-sort/sort-formats/format-json-v1.13/src/main/java/org/apache/inlong/sort/formats/json/utils/FormatJsonUtil.java:
##########
@@ -45,48 +45,27 @@
 
 public class FormatJsonUtil {
 
-    private static final int DEFAULT_DECIMAL_PRECISION = 15;
+    public static final int DEFAULT_CHAR_LENGTH = 255;

Review Comment:
   duplicate in JsonDynamicSchemaFormat



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] dockerzhang merged pull request #8826: [INLONG-8825][Sort] Optimize the field type conversion between source and target in the whole database scenario

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #8826:
URL: https://github.com/apache/inlong/pull/8826


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org