1// Copyright 2020 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.v1beta1;
18
19import "google/api/field_behavior.proto";
20
21option cc_enable_arenas = true;
22option csharp_namespace = "Google.Cloud.DataCatalog.V1Beta1";
23option go_package = "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb;datacatalogpb";
24option java_multiple_files = true;
25option java_package = "com.google.cloud.datacatalog.v1beta1";
26option php_namespace = "Google\\Cloud\\DataCatalog\\V1beta1";
27option ruby_package = "Google::Cloud::DataCatalog::V1beta1";
28
29// Represents a schema (e.g. BigQuery, GoogleSQL, Avro schema).
30message Schema {
31  // Required. Schema of columns. A maximum of 10,000 columns and sub-columns can be
32  // specified.
33  repeated ColumnSchema columns = 2 [(google.api.field_behavior) = REQUIRED];
34}
35
36// Representation of a column within a schema. Columns could be nested inside
37// other columns.
38message ColumnSchema {
39  // Required. Name of the column.
40  string column = 6 [(google.api.field_behavior) = REQUIRED];
41
42  // Required. Type of the column.
43  string type = 1 [(google.api.field_behavior) = REQUIRED];
44
45  // Optional. Description of the column. Default value is an empty string.
46  string description = 2 [(google.api.field_behavior) = OPTIONAL];
47
48  // Optional. A column's mode indicates whether the values in this column are required,
49  // nullable, etc. Only `NULLABLE`, `REQUIRED` and `REPEATED` are supported.
50  // Default mode is `NULLABLE`.
51  string mode = 3 [(google.api.field_behavior) = OPTIONAL];
52
53  // Optional. Schema of sub-columns. A column can have zero or more sub-columns.
54  repeated ColumnSchema subcolumns = 7 [(google.api.field_behavior) = OPTIONAL];
55}
56