You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/11/28 03:23:13 UTC

[GitHub] [inlong] yunqingmoswu commented on a diff in pull request #6641: [INLONG-6639][Sort] Fix DynamicPulsarDeserializationSchema deserialize NPE problem when sourceMetricData is not initialized

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


##########
inlong-sort/sort-connectors/pulsar/src/main/java/org/apache/inlong/sort/pulsar/table/DynamicPulsarDeserializationSchema.java:
##########
@@ -126,7 +126,9 @@ public void deserialize(Message<RowData> message, Collector<RowData> collector)
         // also not for a cartesian product with the keys
         if (keyDeserialization == null && !hasMetadata) {
             valueDeserialization.deserialize(message.getData(), new CallbackCollector<>(inputRow -> {
-                sourceMetricData.outputMetricsWithEstimate(inputRow);
+                if (sourceMetricData != null) {

Review Comment:
   > Should the code complete the initialization of sourceMetricData before entering here? @yunqingmoswu PTAL.
   
   It should be initialized before use, but the indicator is optional. After initialization, the source may still be null, so it is reasonable to add non-null judgment here.
   <img width="996" alt="image" src="https://user-images.githubusercontent.com/44659300/204184285-484df310-dbd9-49b7-8499-ab9e4b96f181.png">



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