1// Copyright 2022 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  // Required. Name of the column.
87  //
88  // Must be a UTF-8 string without dots (.).
89  // The maximum size is 64 bytes.
90  string column = 6 [(google.api.field_behavior) = REQUIRED];
91
92  // Required. Type of the column.
93  //
94  // Must be a UTF-8 string with the maximum size of 128 bytes.
95  string type = 1 [(google.api.field_behavior) = REQUIRED];
96
97  // Optional. Description of the column. Default value is an empty string.
98  //
99  // The description must be a UTF-8 string with the maximum size of 2000
100  // bytes.
101  string description = 2 [(google.api.field_behavior) = OPTIONAL];
102
103  // Optional. A column's mode indicates whether values in this column are
104  // required, nullable, or repeated.
105  //
106  // Only `NULLABLE`, `REQUIRED`, and `REPEATED` values are supported.
107  // Default mode is `NULLABLE`.
108  string mode = 3 [(google.api.field_behavior) = OPTIONAL];
109
110  // Optional. Default value for the column.
111  string default_value = 8 [(google.api.field_behavior) = OPTIONAL];
112
113  // Optional. Ordinal position
114  int32 ordinal_position = 9 [(google.api.field_behavior) = OPTIONAL];
115
116  // Optional. Most important inclusion of this column.
117  IndexingType highest_indexing_type = 10
118      [(google.api.field_behavior) = OPTIONAL];
119
120  // Optional. Schema of sub-columns. A column can have zero or more
121  // sub-columns.
122  repeated ColumnSchema subcolumns = 7 [(google.api.field_behavior) = OPTIONAL];
123
124  // Information only applying for columns in Entries from a specific system.
125  oneof system_spec {
126    // Looker specific column info of this column.
127    LookerColumnSpec looker_column_spec = 18;
128  }
129
130  // Optional. Garbage collection policy for the column or column family.
131  // Applies to systems like Cloud Bigtable.
132  string gc_rule = 11 [(google.api.field_behavior) = OPTIONAL];
133}
134