• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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";
20import "google/api/resource.proto";
21
22option cc_enable_arenas = true;
23option csharp_namespace = "Google.Cloud.DataCatalog.V1";
24option go_package = "cloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpb";
25option java_multiple_files = true;
26option java_package = "com.google.cloud.datacatalog.v1";
27option php_namespace = "Google\\Cloud\\DataCatalog\\V1";
28option ruby_package = "Google::Cloud::DataCatalog::V1";
29
30// Describes a BigQuery table.
31message BigQueryTableSpec {
32  // Output only. The table source type.
33  TableSourceType table_source_type = 1
34      [(google.api.field_behavior) = OUTPUT_ONLY];
35
36  // Output only.
37  oneof type_spec {
38    // Table view specification. Populated only if
39    // the `table_source_type` is `BIGQUERY_VIEW`.
40    ViewSpec view_spec = 2;
41
42    // Specification of a BigQuery table. Populated only if
43    // the `table_source_type` is `BIGQUERY_TABLE`.
44    TableSpec table_spec = 3;
45  }
46}
47
48// Table source type.
49enum TableSourceType {
50  // Default unknown type.
51  TABLE_SOURCE_TYPE_UNSPECIFIED = 0;
52
53  // Table view.
54  BIGQUERY_VIEW = 2;
55
56  // BigQuery native table.
57  BIGQUERY_TABLE = 5;
58
59  // BigQuery materialized view.
60  BIGQUERY_MATERIALIZED_VIEW = 7;
61}
62
63// Table view specification.
64message ViewSpec {
65  // Output only. The query that defines the table view.
66  string view_query = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
67}
68
69// Normal BigQuery table specification.
70message TableSpec {
71  // Output only. If the table is date-sharded, that is, it matches the
72  // `[prefix]YYYYMMDD` name pattern, this field is the Data Catalog resource
73  // name of the date-sharded grouped entry. For example:
74  //
75  // `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`.
76  //
77  // Otherwise, `grouped_entry` is empty.
78  string grouped_entry = 1 [
79    (google.api.field_behavior) = OUTPUT_ONLY,
80    (google.api.resource_reference) = {
81      type: "datacatalog.googleapis.com/Entry"
82    }
83  ];
84}
85
86// Specification for a group of BigQuery tables with the `[prefix]YYYYMMDD` name
87// pattern.
88//
89// For more information, see [Introduction to partitioned tables]
90// (https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding).
91message BigQueryDateShardedSpec {
92  // Output only. The Data Catalog resource name of the dataset entry the
93  // current table belongs to. For example:
94  //
95  // `projects/{PROJECT_ID}/locations/{LOCATION}/entrygroups/{ENTRY_GROUP_ID}/entries/{ENTRY_ID}`.
96  string dataset = 1 [
97    (google.api.field_behavior) = OUTPUT_ONLY,
98    (google.api.resource_reference) = {
99      type: "datacatalog.googleapis.com/Entry"
100    }
101  ];
102
103  // Output only. The table name prefix of the shards.
104  //
105  // The name of any given shard is `[table_prefix]YYYYMMDD`.
106  // For example, for the `MyTable20180101` shard, the
107  // `table_prefix` is `MyTable`.
108  string table_prefix = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
109
110  // Output only. Total number of shards.
111  int64 shard_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
112
113  // Output only. BigQuery resource name of the latest shard.
114  string latest_shard_resource = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
115}
116