tarun11Mavani commented on code in PR #19040:
URL: https://github.com/apache/pinot/pull/19040#discussion_r3664217154


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/openstruct/MutableOpenStructDataSource.java:
##########
@@ -62,10 +63,13 @@ public ComplexFieldSpec getFieldSpec() {
   @Override
   @Nullable
   public DataSource getDataSource(String key) {
-    Map<IndexType, IndexReader> indexes = _index.getIndexes(key);
-    if (indexes == null || indexes.isEmpty()) {
+    MutableKeyColumn col = _index.getKeyColumn(key);
+    if (col == null) {
       return null;
     }
+    Map<IndexType, IndexReader> indexes = new 
HashMap<>(_index.getIndexes(key));

Review Comment:
   `getDataSource(key)` is called at operator setup, not per row. The three 
call sites — `ProjectionBlock.getBlockValueSet`, `ItemTransformFunction.init`, 
`MapFilterOperator.tryPerKeyIndex` — each resolve the key once per segment per 
query and hold the result. So the `HashMap` copy (shallow, ~2–3 entries) and 
the `PresenceBasedNullValueVector` (two fields) are setup-time costs, and 
`getNullBitmap()` fires at most once per key per segment per query.
   



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


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

Reply via email to