1// Copyright 2021 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.v1beta2; 18 19import "google/api/field_behavior.proto"; 20 21option go_package = "cloud.google.com/go/bigquery/storage/apiv1beta2/storagepb;storagepb"; 22option java_multiple_files = true; 23option java_outer_classname = "TableProto"; 24option java_package = "com.google.cloud.bigquery.storage.v1beta2"; 25 26// Schema of a table 27message TableSchema { 28 // Describes the fields in a table. 29 repeated TableFieldSchema fields = 1; 30} 31 32// A field in TableSchema 33message TableFieldSchema { 34 enum Type { 35 // Illegal value 36 TYPE_UNSPECIFIED = 0; 37 38 // 64K, UTF8 39 STRING = 1; 40 41 // 64-bit signed 42 INT64 = 2; 43 44 // 64-bit IEEE floating point 45 DOUBLE = 3; 46 47 // Aggregate type 48 STRUCT = 4; 49 50 // 64K, Binary 51 BYTES = 5; 52 53 // 2-valued 54 BOOL = 6; 55 56 // 64-bit signed usec since UTC epoch 57 TIMESTAMP = 7; 58 59 // Civil date - Year, Month, Day 60 DATE = 8; 61 62 // Civil time - Hour, Minute, Second, Microseconds 63 TIME = 9; 64 65 // Combination of civil date and civil time 66 DATETIME = 10; 67 68 // Geography object 69 GEOGRAPHY = 11; 70 71 // Numeric value 72 NUMERIC = 12; 73 74 // BigNumeric value 75 BIGNUMERIC = 13; 76 77 // Interval 78 INTERVAL = 14; 79 80 // JSON, String 81 JSON = 15; 82 } 83 84 enum Mode { 85 // Illegal value 86 MODE_UNSPECIFIED = 0; 87 88 NULLABLE = 1; 89 90 REQUIRED = 2; 91 92 REPEATED = 3; 93 } 94 95 // Required. The field name. The name must contain only letters (a-z, A-Z), 96 // numbers (0-9), or underscores (_), and must start with a letter or 97 // underscore. The maximum length is 128 characters. 98 string name = 1 [(google.api.field_behavior) = REQUIRED]; 99 100 // Required. The field data type. 101 Type type = 2 [(google.api.field_behavior) = REQUIRED]; 102 103 // Optional. The field mode. The default value is NULLABLE. 104 Mode mode = 3 [(google.api.field_behavior) = OPTIONAL]; 105 106 // Optional. Describes the nested schema fields if the type property is set to STRUCT. 107 repeated TableFieldSchema fields = 4 [(google.api.field_behavior) = OPTIONAL]; 108 109 // Optional. The field description. The maximum length is 1,024 characters. 110 string description = 6 [(google.api.field_behavior) = OPTIONAL]; 111} 112