gianm commented on a change in pull request #9278: Speed up joins on indexed 
tables with string keys
URL: https://github.com/apache/druid/pull/9278#discussion_r372179952
 
 

 ##########
 File path: 
processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java
 ##########
 @@ -262,8 +288,9 @@ public ValueType defaultType()
         final IndexedInts row = selector.getRow();
 
         if (row.size() == 1) {
-          final String key = selector.lookupName(row.get(0));
-          return index.find(key).iterator();
+          int dimensionId = row.get(0);
+          //noinspection ConstantConditions (cache cannot return nulls since 
nulls are never stored in cache)
+          return dimensionCaches.get(selector).get(dimensionId).iterator();
 
 Review comment:
   This is only safe when the selector has a 'real' dictionary, i.e. when 
`selector.getValueCardinality()` does not return 
`DimensionSelector.CARDINALITY_UNKNOWN`. If it is unknown then the ids are not 
valid outside the context of a specific row. So, in that case you'll need to 
fall back to the slower code.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to