xref: /aosp_15_r20/external/googleapis/google/cloud/bigquery/storage/v1beta1/read_options.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.v1beta1;
18
19option go_package = "cloud.google.com/go/bigquery/storage/apiv1beta1/storagepb;storagepb";
20option java_package = "com.google.cloud.bigquery.storage.v1beta1";
21
22// Options dictating how we read a table.
23message TableReadOptions {
24  // Optional. The names of the fields in the table to be returned. If no
25  // field names are specified, then all fields in the table are returned.
26  //
27  // Nested fields -- the child elements of a STRUCT field -- can be selected
28  // individually using their fully-qualified names, and will be returned as
29  // record fields containing only the selected nested fields. If a STRUCT
30  // field is specified in the selected fields list, all of the child elements
31  // will be returned.
32  //
33  // As an example, consider a table with the following schema:
34  //
35  //   {
36  //       "name": "struct_field",
37  //       "type": "RECORD",
38  //       "mode": "NULLABLE",
39  //       "fields": [
40  //           {
41  //               "name": "string_field1",
42  //               "type": "STRING",
43  // .              "mode": "NULLABLE"
44  //           },
45  //           {
46  //               "name": "string_field2",
47  //               "type": "STRING",
48  //               "mode": "NULLABLE"
49  //           }
50  //       ]
51  //   }
52  //
53  // Specifying "struct_field" in the selected fields list will result in a
54  // read session schema with the following logical structure:
55  //
56  //   struct_field {
57  //       string_field1
58  //       string_field2
59  //   }
60  //
61  // Specifying "struct_field.string_field1" in the selected fields list will
62  // result in a read session schema with the following logical structure:
63  //
64  //   struct_field {
65  //       string_field1
66  //   }
67  //
68  // The order of the fields in the read session schema is derived from the
69  // table schema and does not correspond to the order in which the fields are
70  // specified in this list.
71  repeated string selected_fields = 1;
72
73  // Optional. SQL text filtering statement, similar to a WHERE clause in
74  // a SQL query. Aggregates are not supported.
75  //
76  // Examples: "int_field > 5"
77  //           "date_field = CAST('2014-9-27' as DATE)"
78  //           "nullable_field is not NULL"
79  //           "st_equals(geo_field, st_geofromtext("POINT(2, 2)"))"
80  //           "numeric_field BETWEEN 1.0 AND 5.0"
81  //
82  // Restricted to a maximum length for 1 MB.
83  string row_restriction = 2;
84}
85