gortiz commented on code in PR #10184:
URL: https://github.com/apache/pinot/pull/10184#discussion_r1153400489


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/virtualcolumn/VirtualColumnIndexContainer.java:
##########
@@ -46,53 +44,18 @@ public VirtualColumnIndexContainer(ForwardIndexReader<?> 
forwardIndex, InvertedI
     _dictionary = dictionary;
   }
 
+  @Nullable
   @Override
-  public ForwardIndexReader<?> getForwardIndex() {
-    return _forwardIndex;
-  }
-
-  @Override
-  public InvertedIndexReader<?> getInvertedIndex() {
-    return _invertedIndex;
-  }
-
-  @Override
-  public RangeIndexReader<?> getRangeIndex() {
-    return null;
-  }
-
-  @Override
-  public TextIndexReader getTextIndex() {
-    return null;
-  }
-
-  @Override
-  public TextIndexReader getFSTIndex() {
-    return null;
-  }
-
-  @Override
-  public JsonIndexReader getJsonIndex() {
-    return null;
-  }
-
-  @Override
-  public H3IndexReader getH3Index() {
-    return null;
-  }
-
-  @Override
-  public Dictionary getDictionary() {
-    return _dictionary;
-  }
-
-  @Override
-  public BloomFilterReader getBloomFilter() {
-    return null;
-  }
-
-  @Override
-  public NullValueVectorReader getNullValueVector() {
+  public <I extends IndexReader, T extends IndexType<?, I, ?>> I getIndex(T 
indexType) {

Review Comment:
   Do you mean to change the constructor and attributes to something like:
   
   ```java
   public class VirtualColumnIndexContainer implements ColumnIndexContainer {
     Map<IndexType, IndexReader> map;
   
     public VirtualColumnIndexContainer(ForwardIndexReader<?> forwardIndex, 
InvertedIndexReader<?> invertedIndex,
         Dictionary dictionary) {
       map.put(StandardIndexes.forward(), forwardIndex);
       map.put(StandardIndexes.inverted(), invertedIndex);
       map.put(StandardIndexes.dictionary(), dictionary);
     }
   
     @Nullable
     @Override
     public <I extends IndexReader, T extends IndexType<?, I, ?>> I getIndex(T 
indexType) {
       return (I) map.get(indexType);
     }
   ```
   
   I like the current solution more, as it is lighter in the sense that we 
don't need to have a hashmap and we have typechecks in the constructor. But it 
is not a blocker to me, if there is a majority which prefer the map version, we 
can change it.



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