Search in sources :

Example 1 with RootAllocator

use of org.apache.arrow.memory.RootAllocator in project beam by apache.

the class BigQueryIOStorageReadTest method setUp.

@Before
public void setUp() throws Exception {
    FakeDatasetService.setUp();
    allocator = new RootAllocator(Long.MAX_VALUE);
}
Also used : RootAllocator(org.apache.arrow.memory.RootAllocator) Before(org.junit.Before)

Example 2 with RootAllocator

use of org.apache.arrow.memory.RootAllocator in project beam by apache.

the class BigQueryStorageArrowReader method processReadRowsResponse.

@Override
public void processReadRowsResponse(ReadRowsResponse readRowsResponse) throws IOException {
    com.google.cloud.bigquery.storage.v1.ArrowRecordBatch recordBatch = readRowsResponse.getArrowRecordBatch();
    rowCount = recordBatch.getRowCount();
    this.alloc = new RootAllocator(Long.MAX_VALUE);
    InputStream input = protoSchema.getSerializedSchema().newInput();
    Schema arrowSchema = ArrowConversion.arrowSchemaFromInput(input);
    this.recordBatchIterator = ArrowConversion.rowsFromSerializedRecordBatch(arrowSchema, recordBatch.getSerializedRecordBatch().newInput(), this.alloc);
}
Also used : RootAllocator(org.apache.arrow.memory.RootAllocator) InputStream(java.io.InputStream) Schema(org.apache.arrow.vector.types.pojo.Schema) ArrowSchema(com.google.cloud.bigquery.storage.v1.ArrowSchema)

Aggregations

RootAllocator (org.apache.arrow.memory.RootAllocator)2 ArrowSchema (com.google.cloud.bigquery.storage.v1.ArrowSchema)1 InputStream (java.io.InputStream)1 Schema (org.apache.arrow.vector.types.pojo.Schema)1 Before (org.junit.Before)1