java/bench/hive/src/java/org/apache/orc/bench/hive/RowFilterProjectionBenchmark.java [111:151]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Configuration conf = new Configuration();
    TrackingLocalFileSystem fs = new TrackingLocalFileSystem();
    fs.initialize(new URI("file:///"), conf);
    FileSystem.Statistics statistics = fs.getLocalStatistics();
    statistics.reset();
    OrcFile.ReaderOptions options = OrcFile.readerOptions(conf).filesystem(fs);
    Path path = Utilities.getVariant(root, dataset, "orc", compression);
    Reader reader = OrcFile.createReader(path, options);
    TypeDescription schema = reader.getSchema();
    // select an ID column to apply filter on
    String filter_column;
    if ("taxi".equals(dataset)) {
      filter_column = "vendor_id";
    } else if ("sales".equals(dataset)) {
      filter_column = "sales_id";
    } else if ("github".equals(dataset)) {
      filter_column = "id";
    } else {
      throw new IllegalArgumentException("Unknown data set " + dataset);
    }
    boolean[] include = new boolean[schema.getMaximumId() + 1];
    int columns_len = schema.getMaximumId();
    if (projected_columns.compareTo("all") != 0) {
      columns_len = Integer.parseInt(projected_columns);
    }
    // select the remaining columns to project
    List<TypeDescription> children = schema.getChildren();
    boolean foundFilterCol = false;
    for (int c = children.get(0).getId(); c < schema.getMaximumId() + 1; ++c) {
      if (c < schema.getFieldNames().size() &&
          schema.getFieldNames().get(c-1).compareTo(filter_column) == 0) {
        foundFilterCol = true;
        include[c] = true;
      }
      else {
        if (columns_len > 0) {
          include[c] = true;
          columns_len--;
        }
      }
      if (foundFilterCol && (columns_len == 0)) break;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/bench/hive/src/java/org/apache/orc/bench/hive/RowFilterProjectionBenchmark.java [171:211]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Configuration conf = new Configuration();
    TrackingLocalFileSystem fs = new TrackingLocalFileSystem();
    fs.initialize(new URI("file:///"), conf);
    FileSystem.Statistics statistics = fs.getLocalStatistics();
    statistics.reset();
    OrcFile.ReaderOptions options = OrcFile.readerOptions(conf).filesystem(fs);
    Path path = Utilities.getVariant(root, dataset, "orc", compression);
    Reader reader = OrcFile.createReader(path, options);
    TypeDescription schema = reader.getSchema();
    // select an ID column to apply filter on
    String filter_column;
    if ("taxi".equals(dataset)) {
      filter_column = "vendor_id";
    } else if ("sales".equals(dataset)) {
      filter_column = "sales_id";
    } else if ("github".equals(dataset)) {
      filter_column = "id";
    } else {
      throw new IllegalArgumentException("Unknown data set " + dataset);
    }
    boolean[] include = new boolean[schema.getMaximumId() + 1];
    int columns_len = schema.getMaximumId();
    if (projected_columns.compareTo("all") != 0) {
      columns_len = Integer.parseInt(projected_columns);
    }
    // select the remaining columns to project
    List<TypeDescription> children = schema.getChildren();
    boolean foundFilterCol = false;
    for (int c = children.get(0).getId(); c < schema.getMaximumId() + 1; ++c) {
      if (c < schema.getFieldNames().size() &&
          schema.getFieldNames().get(c-1).compareTo(filter_column) == 0) {
        foundFilterCol = true;
        include[c] = true;
      }
      else {
        if (columns_len > 0) {
          include[c] = true;
          columns_len--;
        }
      }
      if (foundFilterCol && (columns_len == 0)) break;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



