viirya commented on code in PR #147:
URL: 
https://github.com/apache/arrow-datafusion-comet/pull/147#discussion_r1508343181


##########
spark/src/main/java/org/apache/spark/sql/comet/CometScalarSubquery.java:
##########
@@ -47,10 +47,12 @@ public static synchronized void setSubquery(long planId, 
ScalarSubquery subquery
   }
 
   public static synchronized void removeSubquery(long planId, ScalarSubquery 
subquery) {
-    subqueryMap.get(planId).remove(subquery.exprId().id());
+    if (subqueryMap.containsKey(planId)) {
+      subqueryMap.get(planId).remove(subquery.exprId().id());

Review Comment:
   I hit NPE here while working sort merge join PR. I think it is possible that 
the query plan has duplicate subqueries (e.g., reused subquery), so if it may 
try to do removal of subquery after the map was clean up.



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

Reply via email to