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


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/datasource/MapDataSource.java:
##########
@@ -33,6 +33,19 @@ public interface MapDataSource extends DataSource {
   /// Returns the DataSource for the given map key's values.
   DataSource getDataSource(String key);
 
+  /// Returns whether this segment has per-key index data for the given key. 
Columnar segments
+  /// return an exact answer (O(1) lookup into the materialized key set). 
Blob-only segments
+  /// return {@code true} conservatively because determining key presence 
requires deserialization.

Review Comment:
   Correcting my earlier reply: `containsKey` is **exact for dense 
(materialized) keys** and **conservatively-true for sparse keys** in mixed-tier 
columns or fully blob segments. Current implementation will be:
    
   ```java
   if (_materializedColumnDataSources.containsKey(key)) return true;   // exact
   return _sparseDataSource != null;                                   // 
conservative
   ```
    
   We can improve this by storing all sparseKeys in the metadata file to 
improve this. Will take it up later. 



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