xref: /aosp_15_r20/external/googleapis/google/cloud/bigquery/storage/v1/arrow.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.bigquery.storage.v1;
18
19option csharp_namespace = "Google.Cloud.BigQuery.Storage.V1";
20option go_package = "cloud.google.com/go/bigquery/storage/apiv1/storagepb;storagepb";
21option java_multiple_files = true;
22option java_outer_classname = "ArrowProto";
23option java_package = "com.google.cloud.bigquery.storage.v1";
24option php_namespace = "Google\\Cloud\\BigQuery\\Storage\\V1";
25
26// Arrow schema as specified in
27// https://arrow.apache.org/docs/python/api/datatypes.html
28// and serialized to bytes using IPC:
29// https://arrow.apache.org/docs/format/Columnar.html#serialization-and-interprocess-communication-ipc
30//
31// See code samples on how this message can be deserialized.
32message ArrowSchema {
33  // IPC serialized Arrow schema.
34  bytes serialized_schema = 1;
35}
36
37// Arrow RecordBatch.
38message ArrowRecordBatch {
39  // IPC-serialized Arrow RecordBatch.
40  bytes serialized_record_batch = 1;
41
42  // [Deprecated] The count of rows in `serialized_record_batch`.
43  // Please use the format-independent ReadRowsResponse.row_count instead.
44  int64 row_count = 2 [deprecated = true];
45}
46
47// Contains options specific to Arrow Serialization.
48message ArrowSerializationOptions {
49  // Compression codec's supported by Arrow.
50  enum CompressionCodec {
51    // If unspecified no compression will be used.
52    COMPRESSION_UNSPECIFIED = 0;
53
54    // LZ4 Frame (https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md)
55    LZ4_FRAME = 1;
56
57    // Zstandard compression.
58    ZSTD = 2;
59  }
60
61  // The compression codec to use for Arrow buffers in serialized record
62  // batches.
63  CompressionCodec buffer_compression = 2;
64}
65