use of org.apache.arrow.vector.FieldVector in project flink by apache.
the class ArrowUtils method createRowDataArrowWriter.
/**
* Creates an {@link ArrowWriter} for the specified {@link VectorSchemaRoot}.
*/
public static ArrowWriter<RowData> createRowDataArrowWriter(VectorSchemaRoot root, RowType rowType) {
ArrowFieldWriter<RowData>[] fieldWriters = new ArrowFieldWriter[root.getFieldVectors().size()];
List<FieldVector> vectors = root.getFieldVectors();
for (int i = 0; i < vectors.size(); i++) {
FieldVector vector = vectors.get(i);
vector.allocateNew();
fieldWriters[i] = createArrowFieldWriterForRow(vector, rowType.getTypeAt(i));
}
return new ArrowWriter<>(root, fieldWriters);
}
Aggregations