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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]