masteryhx commented on code in PR #26473: URL: https://github.com/apache/flink/pull/26473#discussion_r2053581202
########## flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowDataDeserializationSchema.java: ########## @@ -63,18 +65,39 @@ public JsonRowDataDeserializationSchema( } @Override - public RowData deserialize(@Nullable byte[] message) throws IOException { + public void deserialize(@Nullable byte[] message, Collector<RowData> out) throws IOException { if (message == null) { - return null; + return; } try { - return convertToRowData(deserializeToJsonNode(message)); + final JsonNode root = objectMapper.readTree(message); Review Comment: nit: retain the call to the `deserializeToJsonNode` method. ########## flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/AbstractJsonDeserializationSchema.java: ########## @@ -89,6 +101,31 @@ public void open(InitializationContext context) throws Exception { if (hasDecimalType) { objectMapper.enable(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS); } + reusableCollectList = new ArrayList<>(); + collector = new ListCollector<>(reusableCollectList); + } + + /** + * NOTICE: We prefer to keep only {@link DeserializationSchema#deserialize(byte[], Collector)}, + * however, {@link DeserializationSchema#deserialize(byte[])} has not been deprecated now, hence Review Comment: Depracating a method in the public API requires more discussion on Jira even on Dev Mails. I prefer to remove related comments and just assume that it's not deprecated. Of course, I'm +1 for the depracation. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org