Fix: Define the "bigquery.googleapis.com/Table" resource in the BigQuery Storage API (v1beta2).

PiperOrigin-RevId: 294459768
This commit is contained in:
Google APIs 2020-02-11 09:50:28 -08:00 committed by Copybara-Service
parent c7a3caa2c4
commit 8a36b92887
3 changed files with 46 additions and 17 deletions

View File

@ -38,3 +38,21 @@ message ArrowRecordBatch {
// IPC-serialized Arrow RecordBatch.
bytes serialized_record_batch = 1;
}
// Contains options specific to Arrow Serialization.
message ArrowSerializationOptions {
// The IPC format to use when serializing Arrow streams.
enum Format {
// If unspecied the IPC format as of 0.15 release will be used.
FORMAT_UNSPECIFIED = 0;
// Use the legacy IPC message format as of Apache Arrow Release 0.14.
ARROW_0_14 = 1;
// Use the message format as of Apache Arrow Release 0.15.
ARROW_0_15 = 2;
}
// The Arrow IPC format to use.
Format format = 1;
}

View File

@ -64,8 +64,7 @@ service BigQueryRead {
post: "/v1beta2/{read_session.table=projects/*/datasets/*/tables/*}"
body: "*"
};
option (google.api.method_signature) =
"parent,read_session,max_stream_count";
option (google.api.method_signature) = "parent,read_session,max_stream_count";
}
// Reads rows from the stream in the format prescribed by the ReadSession.
@ -94,8 +93,7 @@ service BigQueryRead {
// original, primary, and residual, that original[0-j] = primary[0-j] and
// original[j-n] = residual[0-m] once the streams have been read to
// completion.
rpc SplitReadStream(SplitReadStreamRequest)
returns (SplitReadStreamResponse) {
rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) {
option (google.api.http) = {
get: "/v1beta2/{name=projects/*/locations/*/sessions/*/streams/*}"
};
@ -130,7 +128,12 @@ message CreateReadSessionRequest {
// Request message for `ReadRows`.
message ReadRowsRequest {
// Required. Stream to read rows from.
string read_stream = 1 [(google.api.field_behavior) = REQUIRED];
string read_stream = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "bigquerystorage.googleapis.com/ReadStream"
}
];
// The offset requested must be less than the last row read from Read.
// Requesting a larger offset is undefined. If not specified, start reading

View File

@ -27,6 +27,10 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/storag
option java_multiple_files = true;
option java_outer_classname = "StreamProto";
option java_package = "com.google.cloud.bigquery.storage.v1beta2";
option (google.api.resource_definition) = {
type: "bigquery.googleapis.com/Table"
pattern: "projects/{project}/datasets/{dataset}/tables/{table}"
};
// Data format for input or output data.
enum DataFormat {
@ -72,21 +76,21 @@ message ReadSession {
// "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
// "numeric_field BETWEEN 1.0 AND 5.0"
string row_restriction = 2;
// Optional. Options specific to the Apache Arrow output format.
ArrowSerializationOptions arrow_serialization_options = 3 [(google.api.field_behavior) = OPTIONAL];
}
// Output only. Unique identifier for the session, in the form
// `projects/{project_id}/locations/{location}/sessions/{session_id}`.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Time at which the session becomes invalid. After this time,
// subsequent requests to read this Session will return errors. The
// expire_time is automatically assigned and currently cannot be specified or
// updated.
google.protobuf.Timestamp expire_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. Time at which the session becomes invalid. After this time, subsequent
// requests to read this Session will return errors. The expire_time is
// automatically assigned and currently cannot be specified or updated.
google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
// Immutable. Data format of the output data. Behavior defaults to Apache
// Avro.
// Immutable. Data format of the output data.
DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE];
// The schema for the read. If read_options.selected_fields is set, the
@ -100,12 +104,16 @@ message ReadSession {
ArrowSchema arrow_schema = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
}
// Table that this ReadSession is reading from, in the form
// Immutable. Table that this ReadSession is reading from, in the form
// `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}
string table = 6;
string table = 6 [
(google.api.field_behavior) = IMMUTABLE,
(google.api.resource_reference) = {
type: "bigquery.googleapis.com/Table"
}
];
// Optional. Any modifiers which are applied when reading from the specified
// table.
// Optional. Any modifiers which are applied when reading from the specified table.
TableModifiers table_modifiers = 7 [(google.api.field_behavior) = OPTIONAL];
// Optional. Read options for this session (e.g. column selection, filters).