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/03/01 10:24:16 UTC

[GitHub] [inlong] yunqingmoswu commented on a diff in pull request #7478: [INLONG-7477][Sort] Fix the metadata of table write error for canal-json

yunqingmoswu commented on code in PR #7478:
URL: https://github.com/apache/inlong/pull/7478#discussion_r1121478981


##########
inlong-sort/sort-formats/format-json/src/main/java/org/apache/inlong/sort/formats/json/canal/CanalJsonEnhancedSerializationSchema.java:
##########
@@ -122,9 +127,16 @@ private static RowType createJsonRowType(DataType physicalDataType, List<Writeab
 
     @Override
     public void open(InitializationContext context) {
-        reuse = new GenericRowData(2 + wirteableMetadataFieldGetter.length);
+        int size = 2 + wirteableMetadataFieldGetter.length;
+        if (typeIndex != -1) {
+            size--;
+        }

Review Comment:
   The metadata field  of 'type' has been written as the default value. At this time, the user displays the configured 'type', so the 'type' displayed by the user needs to be removed. At this time, the size of the final written data is reduced by 1.



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