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.datacatalog.v1; 18 19import "google/api/field_behavior.proto"; 20 21option cc_enable_arenas = true; 22option csharp_namespace = "Google.Cloud.DataCatalog.V1"; 23option go_package = "cloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb"; 24option java_multiple_files = true; 25option java_package = "com.google.cloud.datacatalog.v1"; 26option php_namespace = "Google\\Cloud\\DataCatalog\\V1"; 27option ruby_package = "Google::Cloud::DataCatalog::V1"; 28 29// Represents a schema, for example, a BigQuery, GoogleSQL, or Avro schema. 30message Schema { 31 // The unified GoogleSQL-like schema of columns. 32 // 33 // The overall maximum number of columns and nested columns is 10,000. 34 // The maximum nested depth is 15 levels. 35 repeated ColumnSchema columns = 2; 36} 37 38// A column within a schema. Columns can be nested inside 39// other columns. 40message ColumnSchema { 41 // Specifies inclusion of the column in an index 42 enum IndexingType { 43 // Unspecified. 44 INDEXING_TYPE_UNSPECIFIED = 0; 45 46 // Column not a part of an index. 47 INDEXING_TYPE_NONE = 1; 48 49 // Column Part of non unique index. 50 INDEXING_TYPE_NON_UNIQUE = 2; 51 52 // Column part of unique index. 53 INDEXING_TYPE_UNIQUE = 3; 54 55 // Column part of the primary key. 56 INDEXING_TYPE_PRIMARY_KEY = 4; 57 } 58 59 // Column info specific to Looker System. 60 message LookerColumnSpec { 61 // Column type in Looker. 62 enum LookerColumnType { 63 // Unspecified. 64 LOOKER_COLUMN_TYPE_UNSPECIFIED = 0; 65 66 // Dimension. 67 DIMENSION = 1; 68 69 // Dimension group - parent for Dimension. 70 DIMENSION_GROUP = 2; 71 72 // Filter. 73 FILTER = 3; 74 75 // Measure. 76 MEASURE = 4; 77 78 // Parameter. 79 PARAMETER = 5; 80 } 81 82 // Looker specific column type of this column. 83 LookerColumnType type = 1; 84 } 85 86 // Represents the type of a field element. 87 message FieldElementType { 88 // Required. The type of a field element. See 89 // [ColumnSchema.type][google.cloud.datacatalog.v1.ColumnSchema.type]. 90 string type = 1 [(google.api.field_behavior) = REQUIRED]; 91 } 92 93 // Required. Name of the column. 94 // 95 // Must be a UTF-8 string without dots (.). 96 // The maximum size is 64 bytes. 97 string column = 6 [(google.api.field_behavior) = REQUIRED]; 98 99 // Required. Type of the column. 100 // 101 // Must be a UTF-8 string with the maximum size of 128 bytes. 102 string type = 1 [(google.api.field_behavior) = REQUIRED]; 103 104 // Optional. Description of the column. Default value is an empty string. 105 // 106 // The description must be a UTF-8 string with the maximum size of 2000 107 // bytes. 108 string description = 2 [(google.api.field_behavior) = OPTIONAL]; 109 110 // Optional. A column's mode indicates whether values in this column are 111 // required, nullable, or repeated. 112 // 113 // Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported. 114 // Default mode is `NULLABLE`. 115 string mode = 3 [(google.api.field_behavior) = OPTIONAL]; 116 117 // Optional. Default value for the column. 118 string default_value = 8 [(google.api.field_behavior) = OPTIONAL]; 119 120 // Optional. Ordinal position 121 int32 ordinal_position = 9 [(google.api.field_behavior) = OPTIONAL]; 122 123 // Optional. Most important inclusion of this column. 124 IndexingType highest_indexing_type = 10 125 [(google.api.field_behavior) = OPTIONAL]; 126 127 // Optional. Schema of sub-columns. A column can have zero or more 128 // sub-columns. 129 repeated ColumnSchema subcolumns = 7 [(google.api.field_behavior) = OPTIONAL]; 130 131 // Information only applying for columns in Entries from a specific system. 132 oneof system_spec { 133 // Looker specific column info of this column. 134 LookerColumnSpec looker_column_spec = 18; 135 } 136 137 // Optional. The subtype of the RANGE, if the type of this field is RANGE. If 138 // the type is RANGE, this field is required. Possible values for the field 139 // element type of a RANGE include: 140 // * DATE 141 // * DATETIME 142 // * TIMESTAMP 143 FieldElementType range_element_type = 19 144 [(google.api.field_behavior) = OPTIONAL]; 145 146 // Optional. Garbage collection policy for the column or column family. 147 // Applies to systems like Cloud Bigtable. 148 string gc_rule = 11 [(google.api.field_behavior) = OPTIONAL]; 149} 150