table_spec.proto 3.8 KB

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