if (generateNew) generateParquetFile(filename, props);
DrillConfig config = DrillConfig.create();
try(Drillbit bit1 = new Drillbit(config, serviceSet); DrillClient client = new DrillClient(config, serviceSet.getCoordinator())) {
long A = System.nanoTime();
bit1.run();
long B = System.nanoTime();
client.connect();
long C = System.nanoTime();
List<QueryResultBatch> results;
// insert a variable number of reads
if (readEntries != null){
results = client.runQuery(UserProtos.QueryType.LOGICAL, (Files.toString(FileUtils.getResourceAsFile(plan), Charsets.UTF_8).replaceFirst( "&REPLACED_IN_PARQUET_TEST&", readEntries)));
}
else{
results = client.runQuery(UserProtos.QueryType.LOGICAL, Files.toString(FileUtils.getResourceAsFile(plan), Charsets.UTF_8));
}
// List<QueryResultBatch> results = client.runQuery(UserProtos.QueryType.PHYSICAL, Files.toString(FileUtils.getResourceAsFile("/parquet_scan_union_screen_physical.json"), Charsets.UTF_8));
long D = System.nanoTime();
System.out.println(String.format("Took %f s to start drillbit", (float)(B-A) / 1E9));
System.out.println(String.format("Took %f s to connect", (float)(C-B) / 1E9));
System.out.println(String.format("Took %f s to run query", (float)(D-C) / 1E9));
//List<QueryResultBatch> results = client.runQuery(UserProtos.QueryType.PHYSICAL, Files.toString(FileUtils.getResourceAsFile("/parquet_scan_union_screen_physical.json"), Charsets.UTF_8));
int count = 0;
// RecordBatchLoader batchLoader = new RecordBatchLoader(new BootStrapContext(config).getAllocator());
RecordBatchLoader batchLoader = new RecordBatchLoader(bit1.getContext().getAllocator());
byte[] bytes;
int batchCounter = 1;
int columnValCounter = 0;
int i = 0;