// specific tests should call this method, but it is not marked as a test itself intentionally
  public void testParquetFullEngineEventBased(
      boolean testValues,
      boolean generateNew,
      String plan,
      String readEntries,
      String filename,
      int numberOfTimesRead /* specified in json plan */,
      ParquetTestProperties props,
      QueryType queryType)
      throws Exception {
    if (generateNew) TestFileGenerator.generateParquetFile(filename, props);

    ParquetResultListener resultListener =
        new ParquetResultListener(getAllocator(), props, numberOfTimesRead, testValues);
    long C = System.nanoTime();
    String planText = Files.toString(FileUtils.getResourceAsFile(plan), Charsets.UTF_8);
    // substitute in the string for the read entries, allows reuse of the plan file for several
    // tests
    if (readEntries != null) {
      planText = planText.replaceFirst("&REPLACED_IN_PARQUET_TEST&", readEntries);
    }
    this.testWithListener(queryType, planText, resultListener);
    resultListener.getResults();
    long D = System.nanoTime();
    System.out.println(String.format("Took %f s to run query", (float) (D - C) / 1E9));
  }
  private void testFull(
      QueryType type,
      String planText,
      String filename,
      int numberOfTimesRead /* specified in json plan */,
      int numberOfRowGroups,
      int recordsPerRowGroup,
      boolean testValues)
      throws Exception {

    //    RecordBatchLoader batchLoader = new RecordBatchLoader(getAllocator());
    HashMap<String, FieldInfo> fields = new HashMap<>();
    ParquetTestProperties props =
        new ParquetTestProperties(
            numberRowGroups, recordsPerRowGroup, DEFAULT_BYTES_PER_PAGE, fields);
    TestFileGenerator.populateFieldInfoMap(props);
    ParquetResultListener resultListener =
        new ParquetResultListener(getAllocator(), props, numberOfTimesRead, testValues);
    Stopwatch watch = new Stopwatch().start();
    testWithListener(type, planText, resultListener);
    resultListener.getResults();
    //    batchLoader.clear();
    System.out.println(
        String.format("Took %d ms to run query", watch.elapsed(TimeUnit.MILLISECONDS)));
  }
 public void testParquetFullEngineRemote(
     String plan,
     String filename,
     int numberOfTimesRead /* specified in json plan */,
     int numberOfRowGroups,
     int recordsPerRowGroup)
     throws Exception {
   HashMap<String, FieldInfo> fields = new HashMap<>();
   ParquetTestProperties props =
       new ParquetTestProperties(
           numberRowGroups, recordsPerRowGroup, DEFAULT_BYTES_PER_PAGE, fields);
   TestFileGenerator.populateFieldInfoMap(props);
   ParquetResultListener resultListener =
       new ParquetResultListener(getAllocator(), props, numberOfTimesRead, true);
   testWithListener(
       QueryType.PHYSICAL,
       Files.toString(FileUtils.getResourceAsFile(plan), Charsets.UTF_8),
       resultListener);
   resultListener.getResults();
 }