korlov42 commented on a change in pull request #8544:
URL: https://github.com/apache/ignite/pull/8544#discussion_r544087042



##########
File path: 
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/rel/IgniteTableScan.java
##########
@@ -44,7 +44,12 @@
      */
     public IgniteTableScan(RelInput input) {
         super(changeTraits(input, IgniteConvention.INSTANCE));
-        sourceId = ((Number)input.get("sourceId")).longValue();
+
+        Object srcIdObj = input.get("sourceId");
+        if (srcIdObj != null)
+            sourceId = ((Number)srcIdObj).longValue();
+        else
+            sourceId = -1;

Review comment:
       A sourceId is serialised if it is not equal to -1 (see 
`IgniteTableScan#explainTerms0()`). So when deserialising we could get NPE 
here, if the node was serialised with `sourceId=-1`. It's just a matter of time




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

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


Reply via email to