@SuppressWarnings("deprecation")
  public void initialize(
      ParquetInputSplit split,
    JobConf configuration) throws IOException, InterruptedException, HiveException {

    List<BlockMetaData> blocks;

    boolean indexAccess =
      configuration.getBoolean(DataWritableReadSupport.PARQUET_COLUMN_INDEX_ACCESS, false);
    long[] rowGroupOffsets = split.getRowGroupOffsets();

    String columnNames = configuration.get(IOConstants.COLUMNS);
    columnNamesList = DataWritableReadSupport.getColumnNames(columnNames);
    String columnTypes = configuration.get(IOConstants.COLUMNS_TYPES);
    columnTypesList = DataWritableReadSupport.getColumnTypes(columnTypes);

    Set<Long> offsets = new HashSet<>();
    for (long offset : rowGroupOffsets) {
      offsets.add(offset);
    }
    blocks = new ArrayList<>();
    long allRowsInFile = 0;
    int blockIndex = 0;
    for (BlockMetaData block : parquetMetadata.getBlocks()) {
      if (offsets.contains(block.getStartingPos())) {
        rowGroupNumToRowPos.put(blockIndex++, allRowsInFile);
        blocks.add(block);
      }
      allRowsInFile += block.getRowCount();
    }
    // verify we found them all
    if (blocks.size() != rowGroupOffsets.length) {
      long[] foundRowGroupOffsets = new long[parquetMetadata.getBlocks().size()];
      for (int i = 0; i < foundRowGroupOffsets.length; i++) {
        foundRowGroupOffsets[i] = parquetMetadata.getBlocks().get(i).getStartingPos();
      }
      // this should never happen.
      // provide a good error message in case there's a bug
      throw new IllegalStateException(
        "All the offsets listed in the split should be found in the file."
          + " expected: " + Arrays.toString(rowGroupOffsets)
          + " found: " + blocks
          + " out of: " + Arrays.toString(foundRowGroupOffsets)
          + " in range " + split.getStart() + ", " + split.getEnd());
    }

    for (BlockMetaData block : blocks) {
      this.totalRowCount += block.getRowCount();
    }
    this.fileSchema = parquetMetadata.getFileMetaData().getSchema();
    this.writerTimezone = DataWritableReadSupport
        .getWriterTimeZoneId(parquetMetadata.getFileMetaData().getKeyValueMetaData());

    colsToInclude = ColumnProjectionUtils.getReadColumnIDs(configuration);
    requestedSchema = DataWritableReadSupport
      .getRequestedSchema(indexAccess, columnNamesList, columnTypesList, fileSchema, configuration);

    Path path = wrapPathForCache(filePath, cacheKey, configuration, blocks, cacheTag);
    this.reader = new ParquetFileReader(
      configuration, parquetMetadata.getFileMetaData(), path, blocks, requestedSchema.getColumns());
  }
The total number of rows this RecordReader will eventually read. The sum of the
rows of all the row groups.
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/vector/VectorizedParquetRecordReader.java