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.v1beta1; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21 22option cc_enable_arenas = true; 23option csharp_namespace = "Google.Cloud.DataCatalog.V1Beta1"; 24option go_package = "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb;datacatalogpb"; 25option java_multiple_files = true; 26option java_package = "com.google.cloud.datacatalog.v1beta1"; 27option php_namespace = "Google\\Cloud\\DataCatalog\\V1beta1"; 28option ruby_package = "Google::Cloud::DataCatalog::V1beta1"; 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. This field should only be populated if 39 // `table_source_type` is `BIGQUERY_VIEW`. 40 ViewSpec view_spec = 2; 41 42 // Spec of a BigQuery table. This field should only be populated if 43 // `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 spec. 70message TableSpec { 71 // Output only. If the table is a dated shard, i.e., with name pattern 72 // `[prefix]YYYYMMDD`, `grouped_entry` is the Data Catalog resource name of 73 // the date sharded grouped entry, for example, 74 // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}`. 75 // Otherwise, `grouped_entry` is empty. 76 string grouped_entry = 1 [ 77 (google.api.field_behavior) = OUTPUT_ONLY, 78 (google.api.resource_reference) = { 79 type: "datacatalog.googleapis.com/Entry" 80 } 81 ]; 82} 83 84// Spec for a group of BigQuery tables with name pattern `[prefix]YYYYMMDD`. 85// Context: 86// https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding 87message BigQueryDateShardedSpec { 88 // Output only. The Data Catalog resource name of the dataset entry the 89 // current table belongs to, for example, 90 // `projects/{project_id}/locations/{location}/entrygroups/{entry_group_id}/entries/{entry_id}`. 91 string dataset = 1 [ 92 (google.api.field_behavior) = OUTPUT_ONLY, 93 (google.api.resource_reference) = { 94 type: "datacatalog.googleapis.com/Entry" 95 } 96 ]; 97 98 // Output only. The table name prefix of the shards. The name of any given 99 // shard is 100 // `[table_prefix]YYYYMMDD`, for example, for shard `MyTable20180101`, the 101 // `table_prefix` is `MyTable`. 102 string table_prefix = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; 103 104 // Output only. Total number of shards. 105 int64 shard_count = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; 106} 107