Skip to content

Commit 23efea9

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add ZSTD compression as an option for Arrow.
Committer: @emkornfield PiperOrigin-RevId: 374220891
1 parent 0d68bbb commit 23efea9

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

google/cloud/bigquery/storage/v1/arrow.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ message ArrowSerializationOptions {
5252

5353
// LZ4 Frame (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md)
5454
LZ4_FRAME = 1;
55+
56+
// Zstandard compression.
57+
ZSTD = 2;
5558
}
5659

5760
// The compression codec to use for Arrow buffers in serialized record

google/cloud/bigquery/storage/v1/storage.proto

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ service BigQueryRead {
6969
post: "/v1/{read_session.table=projects/*/datasets/*/tables/*}"
7070
body: "*"
7171
};
72-
option (google.api.method_signature) =
73-
"parent,read_session,max_stream_count";
72+
option (google.api.method_signature) = "parent,read_session,max_stream_count";
7473
}
7574

7675
// Reads rows from the stream in the format prescribed by the ReadSession.
@@ -99,8 +98,7 @@ service BigQueryRead {
9998
// original, primary, and residual, that original[0-j] = primary[0-j] and
10099
// original[j-n] = residual[0-m] once the streams have been read to
101100
// completion.
102-
rpc SplitReadStream(SplitReadStreamRequest)
103-
returns (SplitReadStreamResponse) {
101+
rpc SplitReadStream(SplitReadStreamRequest) returns (SplitReadStreamResponse) {
104102
option (google.api.http) = {
105103
get: "/v1/{name=projects/*/locations/*/sessions/*/streams/*}"
106104
};

google/cloud/bigquery/storage/v1/stream.proto

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,20 @@ message ReadSession {
7575
// Restricted to a maximum length for 1 MB.
7676
string row_restriction = 2;
7777

78-
// Optional. Options specific to the Apache Arrow output format.
7978
oneof output_format_serialization_options {
80-
ArrowSerializationOptions arrow_serialization_options = 3
81-
[(google.api.field_behavior) = OPTIONAL];
79+
// Optional. Options specific to the Apache Arrow output format.
80+
ArrowSerializationOptions arrow_serialization_options = 3 [(google.api.field_behavior) = OPTIONAL];
8281
}
8382
}
8483

8584
// Output only. Unique identifier for the session, in the form
8685
// `projects/{project_id}/locations/{location}/sessions/{session_id}`.
8786
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
8887

89-
// Output only. Time at which the session becomes invalid. After this time,
90-
// subsequent requests to read this Session will return errors. The
91-
// expire_time is automatically assigned and currently cannot be specified or
92-
// updated.
93-
google.protobuf.Timestamp expire_time = 2
94-
[(google.api.field_behavior) = OUTPUT_ONLY];
88+
// Output only. Time at which the session becomes invalid. After this time, subsequent
89+
// requests to read this Session will return errors. The expire_time is
90+
// automatically assigned and currently cannot be specified or updated.
91+
google.protobuf.Timestamp expire_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
9592

9693
// Immutable. Data format of the output data.
9794
DataFormat data_format = 3 [(google.api.field_behavior) = IMMUTABLE];
@@ -111,11 +108,12 @@ message ReadSession {
111108
// `projects/{project_id}/datasets/{dataset_id}/tables/{table_id}`
112109
string table = 6 [
113110
(google.api.field_behavior) = IMMUTABLE,
114-
(google.api.resource_reference) = { type: "bigquery.googleapis.com/Table" }
111+
(google.api.resource_reference) = {
112+
type: "bigquery.googleapis.com/Table"
113+
}
115114
];
116115

117-
// Optional. Any modifiers which are applied when reading from the specified
118-
// table.
116+
// Optional. Any modifiers which are applied when reading from the specified table.
119117
TableModifiers table_modifiers = 7 [(google.api.field_behavior) = OPTIONAL];
120118

121119
// Optional. Read options for this session (e.g. column selection, filters).

0 commit comments

Comments
 (0)