Package com.google.cloud.bigquery
Interface ArrowQueryResult
- All Superinterfaces:
AutoCloseable,Iterable<org.apache.arrow.vector.VectorSchemaRoot>
@BetaApi
public interface ArrowQueryResult
extends AutoCloseable, Iterable<org.apache.arrow.vector.VectorSchemaRoot>
[Beta] A query result container providing zero-copy access to Apache Arrow
VectorSchemaRoot batches. This serves as the high-throughput, Arrow-native counterpart to the
canonical TableResult.
Important Usage Warning: The VectorSchemaRoot returned by the iterator is a
single, shared, mutated instance across iterations. Data in the root is only valid during the
current iteration step and will be overwritten or cleared on the next call to Iterator.next(). Callers needing data across iteration steps must copy the data out of
the vectors before advancing the iterator.
Implementations manage direct off-heap native memory buffers. Callers must invoke close() (idiomatically via a try-with-resources block) to ensure native allocations and
underlying gRPC streaming channels are deterministically released.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Releases underlying direct off-heap memory allocations and closes any active stream channels.org.apache.arrow.vector.types.pojo.SchemaReturns the Apache Arrow schema of the result vectors.Returns the reason a job was created when optional job creation was requested, ornullif no job was created or if the query ran via the fallback path.getJobId()Returns the job ID associated with the query execution, ornullif no job was created (e.g. when optional job creation was used).Returns the query ID associated with the query execution, ornullif unavailable.longReturns the total number of rows across all batches if known, or-1if unknown.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getArrowSchema
org.apache.arrow.vector.types.pojo.Schema getArrowSchema()Returns the Apache Arrow schema of the result vectors. -
getJobId
JobId getJobId()Returns the job ID associated with the query execution, ornullif no job was created (e.g. when optional job creation was used). -
getQueryId
String getQueryId()Returns the query ID associated with the query execution, ornullif unavailable. -
getJobCreationReason
JobCreationReason getJobCreationReason()Returns the reason a job was created when optional job creation was requested, ornullif no job was created or if the query ran via the fallback path. -
getTotalRows
long getTotalRows()Returns the total number of rows across all batches if known, or-1if unknown. -
close
void close()Releases underlying direct off-heap memory allocations and closes any active stream channels.- Specified by:
closein interfaceAutoCloseable
-