use of com.google.cloud.bigquery.connector.common.BigQueryStorageReadRowsTracer in project spark-bigquery-connector by GoogleCloudDataproc.
the class ArrowInputPartitionContext method createPartitionReaderContext.
public InputPartitionReaderContext<ColumnarBatch> createPartitionReaderContext() {
BigQueryStorageReadRowsTracer tracer = tracerFactory.newReadRowsTracer(Joiner.on(",").join(streamNames));
List<ReadRowsRequest.Builder> readRowsRequests = streamNames.stream().map(name -> ReadRowsRequest.newBuilder().setReadStream(name)).collect(Collectors.toList());
ReadRowsHelper readRowsHelper = new ReadRowsHelper(bigQueryReadClientFactory, readRowsRequests, options);
tracer.startStream();
Iterator<ReadRowsResponse> readRowsResponses = readRowsHelper.readRows();
return new ArrowColumnBatchPartitionReaderContext(readRowsResponses, serializedArrowSchema, readRowsHelper, selectedFields, tracer, userProvidedSchema.toJavaUtil(), options.numBackgroundThreads());
}
Aggregations