OperatorContext operatorContext = new TaskContext(new TaskId("query", "stage", "task"), executor, session)
.addPipelineContext(true, true)
.addDriverContext()
.addOperatorContext(0, "tpch-generate");
RecordProjectOperator source = new RecordProjectOperator(operatorContext, records);
ColumnFileHandle columnFileHandle = ColumnFileHandle.builder(UUID.randomUUID())
.addColumn(columnHandle, cachedFile, encoding)
.build();
while (!source.isFinished()) {
Page page = source.getOutput();
if (page != null) {
columnFileHandle.append(page);
}
}
columnFileHandle.commit();