private Reader advanceToNextFile() throws IOException {
      while(nextFileIndex < originalFiles.size()) {
        int bucketIdFromPath = AcidUtils.parseBucketId(originalFiles.get(nextFileIndex).getFileStatus().getPath());
        if (bucketIdFromPath == bucketId) {
          break;
        }
        //the the bucket we care about here
        nextFileIndex++;
      }
      if(originalFiles.size() <= nextFileIndex) {
        return null;//no more files for current bucket
      }
      return OrcFile.createReader(originalFiles.get(nextFileIndex++).getFileStatus().
        getPath(), OrcFile.readerOptions(conf));
    }
Finds the next file of the logical bucket
@return {@code null} if there are no more files
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRawRecordMerger.java