snleee commented on a change in pull request #5482:
URL: https://github.com/apache/incubator-pinot/pull/5482#discussion_r437024926



##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/indexsegment/immutable/ImmutableSegmentImpl.java
##########
@@ -60,7 +60,11 @@ public ImmutableSegmentImpl(SegmentDirectory 
segmentDirectory, SegmentMetadataIm
 
   @Override
   public Dictionary getDictionary(String column) {
-    return _indexContainerMap.get(column).getDictionary();
+    ColumnIndexContainer container = _indexContainerMap.get(column);

Review comment:
       ```
   try {
     return _indexContainerMap.get(column).getDictionary()
   } catch (NullPointerException e) {
     LOGGER.error("Invalid column: {}", column, e);
     throw e;
   }
   ```
   Something like the above is probably better.

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/indexsegment/immutable/ImmutableSegmentImpl.java
##########
@@ -60,7 +60,11 @@ public ImmutableSegmentImpl(SegmentDirectory 
segmentDirectory, SegmentMetadataIm
 
   @Override
   public Dictionary getDictionary(String column) {
-    return _indexContainerMap.get(column).getDictionary();
+    ColumnIndexContainer container = _indexContainerMap.get(column);

Review comment:
       ```
   try {
     return _indexContainerMap.get(column).getDictionary()
   } catch (NullPointerException e) {
     LOGGER.error("Invalid column: {}", column, e);
     throw e;
   }
   ```
   Something like the above is probably better.

##########
File path: 
pinot-core/src/main/java/org/apache/pinot/core/indexsegment/immutable/ImmutableSegmentImpl.java
##########
@@ -60,7 +60,11 @@ public ImmutableSegmentImpl(SegmentDirectory 
segmentDirectory, SegmentMetadataIm
 
   @Override
   public Dictionary getDictionary(String column) {
-    return _indexContainerMap.get(column).getDictionary();
+    ColumnIndexContainer container = _indexContainerMap.get(column);
+    if (container == null) {

Review comment:
       ```
   Preconditions.checkNotNull(container, "Invalid column: " + column);
   ```




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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to