Jackie-Jiang commented on a change in pull request #6924: URL: https://github.com/apache/incubator-pinot/pull/6924#discussion_r634808469
########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentImpl.java ########## @@ -170,8 +174,12 @@ public ValidDocIndexReader getValidDocIndex() { @Override public GenericRow getRecord(int docId, GenericRow reuse) { - // NOTE: Use PinotSegmentRecordReader to read immutable segment - throw new UnsupportedOperationException(); + try { + _pinotSegmentRecordReader.getRecord(reuse, docId); Review comment: Also need to close the record reader if not null in `destroy()` ########## File path: pinot-segment-local/src/main/java/org/apache/pinot/segment/local/indexsegment/immutable/ImmutableSegmentImpl.java ########## @@ -170,8 +174,12 @@ public ValidDocIndexReader getValidDocIndex() { @Override public GenericRow getRecord(int docId, GenericRow reuse) { - // NOTE: Use PinotSegmentRecordReader to read immutable segment - throw new UnsupportedOperationException(); + try { + _pinotSegmentRecordReader.getRecord(reuse, docId); Review comment: ```suggestion if (_pinotSegmentRecordReader = null) { _pinotSegmentRecordReader = new PinotSegmentRecordReader(); _pinotSegmentRecordReader.init(this); } _pinotSegmentRecordReader.getRecord(reuse, docId); ``` -- 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