You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/04/24 22:30:03 UTC

[GitHub] [druid] jihoonson commented on a change in pull request #9760: Fix potential NPEs in joins

jihoonson commented on a change in pull request #9760:
URL: https://github.com/apache/druid/pull/9760#discussion_r414282640



##########
File path: processing/src/main/java/org/apache/druid/segment/join/lookup/LookupJoinMatcher.java
##########
@@ -277,7 +277,7 @@ public void matchRemainder()
     } else {
       currentIterator = Iterators.filter(
           extractor.iterable().iterator(),
-          entry -> !matchedKeys.contains(entry.getKey())
+          entry -> entry != null && !matchedKeys.contains(entry.getKey())

Review comment:
       When can `entry` be null?

##########
File path: processing/src/main/java/org/apache/druid/segment/join/PossiblyNullDimensionSelector.java
##########
@@ -138,7 +138,8 @@ public int lookupId(@Nullable String name)
       // id 0 is always null for this selector impl.
       return 0;
     } else {
-      return baseSelector.idLookup().lookupId(name) + nullAdjustment;
+      IdLookup idLookup = baseSelector.idLookup();
+      return (idLookup == null ? 0 : idLookup.lookupId(name)) + nullAdjustment;

Review comment:
       It should probably fail if `idLooup` = null.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org