Skip to content

Commit ec44b3c

Browse files
feat: [metastore] added Admin Interface (v1) (#4392)
* feat: added Admin Interface (v1) feat: added gRPC endpoint protocol (v1) feat: added BigQuery as a backend metastore (v1) PiperOrigin-RevId: 545570906 Source-Link: googleapis/googleapis@ba4742e Source-Link: googleapis/googleapis-gen@ab122fc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLW1ldGFzdG9yZS8uT3dsQm90LnlhbWwiLCJoIjoiYWIxMjJmY2RmYzI2OGY3NTc2MzdmZDVjNzRkOWI5Zjk2NWQwMmNmMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Denis DelGrosso <85250797+ddelgrosso1@users.noreply.github.com>
1 parent 685b1ad commit ec44b3c

17 files changed

Lines changed: 5457 additions & 341 deletions

packages/google-cloud-metastore/README.md

Lines changed: 74 additions & 72 deletions
Large diffs are not rendered by default.

packages/google-cloud-metastore/protos/google/cloud/metastore/v1/metastore.proto

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,48 @@ service DataprocMetastore {
238238
metadata_type: "google.cloud.metastore.v1.OperationMetadata"
239239
};
240240
}
241+
242+
// Query DPMS metadata.
243+
rpc QueryMetadata(QueryMetadataRequest)
244+
returns (google.longrunning.Operation) {
245+
option (google.api.http) = {
246+
post: "/v1/{service=projects/*/locations/*/services/*}:queryMetadata"
247+
body: "*"
248+
};
249+
option (google.longrunning.operation_info) = {
250+
response_type: "QueryMetadataResponse"
251+
metadata_type: "google.cloud.metastore.v1.OperationMetadata"
252+
};
253+
}
254+
255+
// Move a table to another database.
256+
rpc MoveTableToDatabase(MoveTableToDatabaseRequest)
257+
returns (google.longrunning.Operation) {
258+
option (google.api.http) = {
259+
post: "/v1/{service=projects/*/locations/*/services/*}:moveTableToDatabase"
260+
body: "*"
261+
};
262+
option (google.longrunning.operation_info) = {
263+
response_type: "MoveTableToDatabaseResponse"
264+
metadata_type: "google.cloud.metastore.v1.OperationMetadata"
265+
};
266+
}
267+
268+
// Alter metadata resource location. The metadata resource can be a database,
269+
// table, or partition. This functionality only updates the parent directory
270+
// for the respective metadata resource and does not transfer any existing
271+
// data to the new location.
272+
rpc AlterMetadataResourceLocation(AlterMetadataResourceLocationRequest)
273+
returns (google.longrunning.Operation) {
274+
option (google.api.http) = {
275+
post: "/v1/{service=projects/*/locations/*/services/*}:alterLocation"
276+
body: "*"
277+
};
278+
option (google.longrunning.operation_info) = {
279+
response_type: "AlterMetadataResourceLocationResponse"
280+
metadata_type: "google.cloud.metastore.v1.OperationMetadata"
281+
};
282+
}
241283
}
242284

243285
// A managed metastore service that serves metadata queries.
@@ -425,6 +467,18 @@ message MaintenanceWindow {
425467
// Specifies configuration information specific to running Hive metastore
426468
// software as the metastore service.
427469
message HiveMetastoreConfig {
470+
// Protocols available for serving the metastore service endpoint.
471+
enum EndpointProtocol {
472+
// The protocol is not set.
473+
ENDPOINT_PROTOCOL_UNSPECIFIED = 0;
474+
475+
// Use the legacy Apache Thrift protocol for the metastore service endpoint.
476+
THRIFT = 1;
477+
478+
// Use the modernized gRPC protocol for the metastore service endpoint.
479+
GRPC = 2;
480+
}
481+
428482
// Immutable. The Hive metastore schema version.
429483
string version = 1 [(google.api.field_behavior) = IMMUTABLE];
430484

@@ -442,6 +496,10 @@ message HiveMetastoreConfig {
442496
// while omitting this field from the request's `service`.
443497
KerberosConfig kerberos_config = 3;
444498

499+
// The protocol to use for the metastore service endpoint. If unspecified,
500+
// defaults to `THRIFT`.
501+
EndpointProtocol endpoint_protocol = 4;
502+
445503
// A mapping of Hive metastore version to the auxiliary version
446504
// configuration. When specified, a secondary Hive metastore service is
447505
// created along with the primary service. All auxiliary versions must be less
@@ -592,6 +650,9 @@ message MetadataImport {
592650
// to import metadata. It must begin with `gs://`.
593651
string gcs_uri = 2;
594652

653+
// The name of the source database.
654+
string source_database = 3 [deprecated = true];
655+
595656
// Optional. The type of the database dump. If unspecified, defaults to
596657
// `MYSQL`.
597658
DatabaseDumpSpec.Type type = 4 [(google.api.field_behavior) = OPTIONAL];
@@ -1441,3 +1502,101 @@ message DatabaseDumpSpec {
14411502
AVRO = 2;
14421503
}
14431504
}
1505+
1506+
// Request message for
1507+
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
1508+
message QueryMetadataRequest {
1509+
// Required. The relative resource name of the metastore service to query
1510+
// metadata, in the following format:
1511+
//
1512+
// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1513+
string service = 1 [
1514+
(google.api.field_behavior) = REQUIRED,
1515+
(google.api.resource_reference) = {
1516+
type: "metastore.googleapis.com/Service"
1517+
}
1518+
];
1519+
1520+
// Required. A read-only SQL query to execute against the metadata database.
1521+
// The query cannot change or mutate the data.
1522+
string query = 2 [(google.api.field_behavior) = REQUIRED];
1523+
}
1524+
1525+
// Response message for
1526+
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
1527+
message QueryMetadataResponse {
1528+
// The manifest URI is link to a JSON instance in Cloud Storage.
1529+
// This instance manifests immediately along with QueryMetadataResponse. The
1530+
// content of the URI is not retriable until the long-running operation query
1531+
// against the metadata finishes.
1532+
string result_manifest_uri = 1;
1533+
}
1534+
1535+
// Error details in public error message for
1536+
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1.DataprocMetastore.QueryMetadata].
1537+
message ErrorDetails {
1538+
// Additional structured details about this error.
1539+
//
1540+
// Keys define the failure items.
1541+
// Value describes the exception or details of the item.
1542+
map<string, string> details = 1;
1543+
}
1544+
1545+
// Request message for
1546+
// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
1547+
message MoveTableToDatabaseRequest {
1548+
// Required. The relative resource name of the metastore service to mutate
1549+
// metadata, in the following format:
1550+
//
1551+
// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1552+
string service = 1 [
1553+
(google.api.field_behavior) = REQUIRED,
1554+
(google.api.resource_reference) = {
1555+
type: "metastore.googleapis.com/Service"
1556+
}
1557+
];
1558+
1559+
// Required. The name of the table to be moved.
1560+
string table_name = 2 [(google.api.field_behavior) = REQUIRED];
1561+
1562+
// Required. The name of the database where the table resides.
1563+
string db_name = 3 [(google.api.field_behavior) = REQUIRED];
1564+
1565+
// Required. The name of the database where the table should be moved.
1566+
string destination_db_name = 4 [(google.api.field_behavior) = REQUIRED];
1567+
}
1568+
1569+
// Response message for
1570+
// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1.DataprocMetastore.MoveTableToDatabase].
1571+
message MoveTableToDatabaseResponse {}
1572+
1573+
// Request message for
1574+
// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
1575+
message AlterMetadataResourceLocationRequest {
1576+
// Required. The relative resource name of the metastore service to mutate
1577+
// metadata, in the following format:
1578+
//
1579+
// `projects/{project_id}/locations/{location_id}/services/{service_id}`.
1580+
string service = 1 [
1581+
(google.api.field_behavior) = REQUIRED,
1582+
(google.api.resource_reference) = {
1583+
type: "metastore.googleapis.com/Service"
1584+
}
1585+
];
1586+
1587+
// Required. The relative metadata resource name in the following format.
1588+
//
1589+
// `databases/{database_id}`
1590+
// or
1591+
// `databases/{database_id}/tables/{table_id}`
1592+
// or
1593+
// `databases/{database_id}/tables/{table_id}/partitions/{partition_id}`
1594+
string resource_name = 2 [(google.api.field_behavior) = REQUIRED];
1595+
1596+
// Required. The new location URI for the metadata resource.
1597+
string location_uri = 3 [(google.api.field_behavior) = REQUIRED];
1598+
}
1599+
1600+
// Response message for
1601+
// [DataprocMetastore.AlterMetadataResourceLocation][google.cloud.metastore.v1.DataprocMetastore.AlterMetadataResourceLocation].
1602+
message AlterMetadataResourceLocationResponse {}

packages/google-cloud-metastore/protos/google/cloud/metastore/v1/metastore_federation.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ message BackendMetastore {
188188
// The metastore type is not set.
189189
METASTORE_TYPE_UNSPECIFIED = 0;
190190

191+
// The backend metastore is BigQuery.
192+
BIGQUERY = 2;
193+
191194
// The backend metastore is Dataproc Metastore.
192195
DATAPROC_METASTORE = 3;
193196
}

packages/google-cloud-metastore/protos/google/cloud/metastore/v1alpha/metastore.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,16 @@ message QueryMetadataResponse {
16111611
string result_manifest_uri = 1;
16121612
}
16131613

1614+
// Error details in public error message for
1615+
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1alpha.DataprocMetastore.QueryMetadata].
1616+
message ErrorDetails {
1617+
// Additional structured details about this error.
1618+
//
1619+
// Keys define the failure items.
1620+
// Value describes the exception or details of the item.
1621+
map<string, string> details = 1;
1622+
}
1623+
16141624
// Request message for
16151625
// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1alpha.DataprocMetastore.MoveTableToDatabase].
16161626
message MoveTableToDatabaseRequest {

packages/google-cloud-metastore/protos/google/cloud/metastore/v1beta/metastore.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,16 @@ message QueryMetadataResponse {
16111611
string result_manifest_uri = 1;
16121612
}
16131613

1614+
// Error details in public error message for
1615+
// [DataprocMetastore.QueryMetadata][google.cloud.metastore.v1beta.DataprocMetastore.QueryMetadata].
1616+
message ErrorDetails {
1617+
// Additional structured details about this error.
1618+
//
1619+
// Keys define the failure items.
1620+
// Value describes the exception or details of the item.
1621+
map<string, string> details = 1;
1622+
}
1623+
16141624
// Request message for
16151625
// [DataprocMetastore.MoveTableToDatabase][google.cloud.metastore.v1beta.DataprocMetastore.MoveTableToDatabase].
16161626
message MoveTableToDatabaseRequest {

0 commit comments

Comments
 (0)