-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
metastore.proto
668 lines (571 loc) · 22.9 KB
/
metastore.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
package google.cloud.bigquery.biglake.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
option go_package = "cloud.google.com/go/bigquery/biglake/apiv1/biglakepb;biglakepb";
option java_multiple_files = true;
option java_outer_classname = "MetastoreProto";
option java_package = "com.google.cloud.bigquery.biglake.v1";
// BigLake Metastore is a serverless, highly available, multi-tenant runtime
// metastore for Google Cloud Data Analytics products.
//
// The BigLake Metastore API defines the following resource model:
//
// * A collection of Google Cloud projects: `/projects/*`
// * Each project has a collection of available locations: `/locations/*`
// * Each location has a collection of catalogs: `/catalogs/*`
// * Each catalog has a collection of databases: `/databases/*`
// * Each database has a collection of tables: `/tables/*`
service MetastoreService {
option (google.api.default_host) = "biglake.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/bigquery,"
"https://www.googleapis.com/auth/cloud-platform";
// Creates a new catalog.
rpc CreateCatalog(CreateCatalogRequest) returns (Catalog) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/catalogs"
body: "catalog"
};
option (google.api.method_signature) = "parent,catalog,catalog_id";
}
// Deletes an existing catalog specified by the catalog ID.
rpc DeleteCatalog(DeleteCatalogRequest) returns (Catalog) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/catalogs/*}"
};
option (google.api.method_signature) = "name";
}
// Gets the catalog specified by the resource name.
rpc GetCatalog(GetCatalogRequest) returns (Catalog) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/catalogs/*}"
};
option (google.api.method_signature) = "name";
}
// List all catalogs in a specified project.
rpc ListCatalogs(ListCatalogsRequest) returns (ListCatalogsResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/catalogs"
};
option (google.api.method_signature) = "parent";
}
// Creates a new database.
rpc CreateDatabase(CreateDatabaseRequest) returns (Database) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/catalogs/*}/databases"
body: "database"
};
option (google.api.method_signature) = "parent,database,database_id";
}
// Deletes an existing database specified by the database ID.
rpc DeleteDatabase(DeleteDatabaseRequest) returns (Database) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*}"
};
option (google.api.method_signature) = "name";
}
// Updates an existing database specified by the database ID.
rpc UpdateDatabase(UpdateDatabaseRequest) returns (Database) {
option (google.api.http) = {
patch: "/v1/{database.name=projects/*/locations/*/catalogs/*/databases/*}"
body: "database"
};
option (google.api.method_signature) = "database,update_mask";
}
// Gets the database specified by the resource name.
rpc GetDatabase(GetDatabaseRequest) returns (Database) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*}"
};
option (google.api.method_signature) = "name";
}
// List all databases in a specified catalog.
rpc ListDatabases(ListDatabasesRequest) returns (ListDatabasesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/catalogs/*}/databases"
};
option (google.api.method_signature) = "parent";
}
// Creates a new table.
rpc CreateTable(CreateTableRequest) returns (Table) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/catalogs/*/databases/*}/tables"
body: "table"
};
option (google.api.method_signature) = "parent,table,table_id";
}
// Deletes an existing table specified by the table ID.
rpc DeleteTable(DeleteTableRequest) returns (Table) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*/tables/*}"
};
option (google.api.method_signature) = "name";
}
// Updates an existing table specified by the table ID.
rpc UpdateTable(UpdateTableRequest) returns (Table) {
option (google.api.http) = {
patch: "/v1/{table.name=projects/*/locations/*/catalogs/*/databases/*/tables/*}"
body: "table"
};
option (google.api.method_signature) = "table,update_mask";
}
// Renames an existing table specified by the table ID.
rpc RenameTable(RenameTableRequest) returns (Table) {
option (google.api.http) = {
post: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*/tables/*}:rename"
body: "*"
};
option (google.api.method_signature) = "name,new_name";
}
// Gets the table specified by the resource name.
rpc GetTable(GetTableRequest) returns (Table) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/catalogs/*/databases/*/tables/*}"
};
option (google.api.method_signature) = "name";
}
// List all tables in a specified database.
rpc ListTables(ListTablesRequest) returns (ListTablesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*/catalogs/*/databases/*}/tables"
};
option (google.api.method_signature) = "parent";
}
}
// View on Table. Represents which fields will be populated for calls that
// return Table objects.
enum TableView {
// Default value. The API will default to the BASIC view.
TABLE_VIEW_UNSPECIFIED = 0;
// Include only table names.
// This is the default value.
BASIC = 1;
// Include everything.
FULL = 2;
}
// Catalog is the container of databases.
message Catalog {
option (google.api.resource) = {
type: "biglake.googleapis.com/Catalog"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}"
};
// Output only. The resource name.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" }
];
// Output only. The creation time of the catalog.
google.protobuf.Timestamp create_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last modification time of the catalog.
google.protobuf.Timestamp update_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The deletion time of the catalog. Only set after the catalog
// is deleted.
google.protobuf.Timestamp delete_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when this catalog is considered expired. Only set
// after the catalog is deleted.
google.protobuf.Timestamp expire_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];
}
// Database is the container of tables.
message Database {
option (google.api.resource) = {
type: "biglake.googleapis.com/Database"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/databases/{database}"
};
// The database type.
enum Type {
// The type is not specified.
TYPE_UNSPECIFIED = 0;
// Represents a database storing tables compatible with Hive Metastore
// tables.
HIVE = 1;
}
// Options specified for the database type.
oneof options {
// Options of a Hive database.
HiveDatabaseOptions hive_options = 7;
}
// Output only. The resource name.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = {
type: "biglake.googleapis.com/Database"
}
];
// Output only. The creation time of the database.
google.protobuf.Timestamp create_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last modification time of the database.
google.protobuf.Timestamp update_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The deletion time of the database. Only set after the database
// is deleted.
google.protobuf.Timestamp delete_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when this database is considered expired. Only set
// after the database is deleted.
google.protobuf.Timestamp expire_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];
// The database type.
Type type = 6;
}
// Represents a table.
message Table {
option (google.api.resource) = {
type: "biglake.googleapis.com/Table"
pattern: "projects/{project}/locations/{location}/catalogs/{catalog}/databases/{database}/tables/{table}"
};
// The table type.
enum Type {
// The type is not specified.
TYPE_UNSPECIFIED = 0;
// Represents a table compatible with Hive Metastore tables.
HIVE = 1;
}
// Options specified for the table type.
oneof options {
// Options of a Hive table.
HiveTableOptions hive_options = 7;
}
// Output only. The resource name.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Table" }
];
// Output only. The creation time of the table.
google.protobuf.Timestamp create_time = 2
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The last modification time of the table.
google.protobuf.Timestamp update_time = 3
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The deletion time of the table. Only set after the table is
// deleted.
google.protobuf.Timestamp delete_time = 4
[(google.api.field_behavior) = OUTPUT_ONLY];
// Output only. The time when this table is considered expired. Only set after
// the table is deleted.
google.protobuf.Timestamp expire_time = 5
[(google.api.field_behavior) = OUTPUT_ONLY];
// The table type.
Type type = 6;
// The checksum of a table object computed by the server based on the value of
// other fields. It may be sent on update requests to ensure the client has an
// up-to-date value before proceeding. It is only checked for update table
// operations.
string etag = 8;
}
// Request message for the CreateCatalog method.
message CreateCatalogRequest {
// Required. The parent resource where this catalog will be created.
// Format: projects/{project_id_or_number}/locations/{location_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// Required. The catalog to create.
// The `name` field does not need to be provided.
Catalog catalog = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the catalog, which will become the final
// component of the catalog's resource name.
string catalog_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request message for the DeleteCatalog method.
message DeleteCatalogRequest {
// Required. The name of the catalog to delete.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" }
];
}
// Request message for the GetCatalog method.
message GetCatalogRequest {
// Required. The name of the catalog to retrieve.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" }
];
}
// Request message for the ListCatalogs method.
message ListCatalogsRequest {
// Required. The parent, which owns this collection of catalogs.
// Format: projects/{project_id_or_number}/locations/{location_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "locations.googleapis.com/Location"
}
];
// The maximum number of catalogs to return. The service may return fewer than
// this value.
// If unspecified, at most 50 catalogs will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 2;
// A page token, received from a previous `ListCatalogs` call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListCatalogs` must match
// the call that provided the page token.
string page_token = 3;
}
// Response message for the ListCatalogs method.
message ListCatalogsResponse {
// The catalogs from the specified project.
repeated Catalog catalogs = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Request message for the CreateDatabase method.
message CreateDatabaseRequest {
// Required. The parent resource where this database will be created.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" }
];
// Required. The database to create.
// The `name` field does not need to be provided.
Database database = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the database, which will become the final
// component of the database's resource name.
string database_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request message for the DeleteDatabase method.
message DeleteDatabaseRequest {
// Required. The name of the database to delete.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "biglake.googleapis.com/Database"
}
];
}
// Request message for the UpdateDatabase method.
message UpdateDatabaseRequest {
// Required. The database to update.
//
// The database's `name` field is used to identify the database to update.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
Database database = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to update.
//
// For the `FieldMask` definition, see
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
// If not set, defaults to all of the fields that are allowed to update.
google.protobuf.FieldMask update_mask = 2;
}
// Request message for the GetDatabase method.
message GetDatabaseRequest {
// Required. The name of the database to retrieve.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "biglake.googleapis.com/Database"
}
];
}
// Request message for the ListDatabases method.
message ListDatabasesRequest {
// Required. The parent, which owns this collection of databases.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Catalog" }
];
// The maximum number of databases to return. The service may return fewer
// than this value.
// If unspecified, at most 50 databases will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 2;
// A page token, received from a previous `ListDatabases` call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListDatabases` must
// match the call that provided the page token.
string page_token = 3;
}
// Response message for the ListDatabases method.
message ListDatabasesResponse {
// The databases from the specified catalog.
repeated Database databases = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Request message for the CreateTable method.
message CreateTableRequest {
// Required. The parent resource where this table will be created.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "biglake.googleapis.com/Database"
}
];
// Required. The table to create. The `name` field does not need to be
// provided for the table creation.
Table table = 2 [(google.api.field_behavior) = REQUIRED];
// Required. The ID to use for the table, which will become the final
// component of the table's resource name.
string table_id = 3 [(google.api.field_behavior) = REQUIRED];
}
// Request message for the DeleteTable method.
message DeleteTableRequest {
// Required. The name of the table to delete.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Table" }
];
}
// Request message for the UpdateTable method.
message UpdateTableRequest {
// Required. The table to update.
//
// The table's `name` field is used to identify the table to update.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
Table table = 1 [(google.api.field_behavior) = REQUIRED];
// The list of fields to update.
//
// For the `FieldMask` definition, see
// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
// If not set, defaults to all of the fields that are allowed to update.
google.protobuf.FieldMask update_mask = 2;
}
// Request message for the RenameTable method in MetastoreService
message RenameTableRequest {
// Required. The table's `name` field is used to identify the table to rename.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Table" }
];
// Required. The new `name` for the specified table, must be in the same
// database. Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
string new_name = 2 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Table" }
];
}
// Request message for the GetTable method.
message GetTableRequest {
// Required. The name of the table to retrieve.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "biglake.googleapis.com/Table" }
];
}
// Request message for the ListTables method.
message ListTablesRequest {
// Required. The parent, which owns this collection of tables.
// Format:
// projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "biglake.googleapis.com/Database"
}
];
// The maximum number of tables to return. The service may return fewer than
// this value.
// If unspecified, at most 50 tables will be returned.
// The maximum value is 1000; values above 1000 will be coerced to 1000.
int32 page_size = 2;
// A page token, received from a previous `ListTables` call.
// Provide this to retrieve the subsequent page.
//
// When paginating, all other parameters provided to `ListTables` must match
// the call that provided the page token.
string page_token = 3;
// The view for the returned tables.
TableView view = 4;
}
// Response message for the ListTables method.
message ListTablesResponse {
// The tables from the specified database.
repeated Table tables = 1;
// A token, which can be sent as `page_token` to retrieve the next page.
// If this field is omitted, there are no subsequent pages.
string next_page_token = 2;
}
// Options of a Hive database.
message HiveDatabaseOptions {
// Cloud Storage folder URI where the database data is stored, starting with
// "gs://".
string location_uri = 1;
// Stores user supplied Hive database parameters.
map<string, string> parameters = 2;
}
// Options of a Hive table.
message HiveTableOptions {
// Serializer and deserializer information.
message SerDeInfo {
// The fully qualified Java class name of the serialization library.
string serialization_lib = 1;
}
// Stores physical storage information of the data.
message StorageDescriptor {
// Cloud Storage folder URI where the table data is stored, starting with
// "gs://".
string location_uri = 1;
// The fully qualified Java class name of the input format.
string input_format = 2;
// The fully qualified Java class name of the output format.
string output_format = 3;
// Serializer and deserializer information.
SerDeInfo serde_info = 4;
}
// Stores user supplied Hive table parameters.
map<string, string> parameters = 1;
// Hive table type. For example, MANAGED_TABLE, EXTERNAL_TABLE.
string table_type = 2;
// Stores physical storage information of the data.
StorageDescriptor storage_descriptor = 3;
}