Skip to content

Commit 9d4d06b

Browse files
authored
feat(bigquery): add BigLake API (#11882)
1 parent 2417284 commit 9d4d06b

40 files changed

Lines changed: 5069 additions & 0 deletions
123 KB
Binary file not shown.

ci/etc/expected_install_directories

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@
117117
./include/google/cloud/bigquery/analyticshub/v1
118118
./include/google/cloud/bigquery/analyticshub/v1/internal
119119
./include/google/cloud/bigquery/analyticshub/v1/mocks
120+
./include/google/cloud/bigquery/biglake
121+
./include/google/cloud/bigquery/biglake/v1
122+
./include/google/cloud/bigquery/biglake/v1/internal
123+
./include/google/cloud/bigquery/biglake/v1/mocks
120124
./include/google/cloud/bigquery/connection
121125
./include/google/cloud/bigquery/connection/v1
122126
./include/google/cloud/bigquery/connection/v1/internal

external/googleapis/protolists/bigquery.list

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub.proto
2+
@com_google_googleapis//google/cloud/bigquery/biglake/v1:metastore.proto
23
@com_google_googleapis//google/cloud/bigquery/connection/v1:connection.proto
34
@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicy.proto
45
@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer.proto

external/googleapis/update_libraries.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ declare -A -r LIBRARIES=(
6060
# This is long enough that it needs to be kept in alphabetical order
6161
printf ",%s" \
6262
"@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc" \
63+
"@com_google_googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc" \
6364
"@com_google_googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc" \
6465
"@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc" \
6566
"@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc" \

generator/generator_config.textproto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,13 @@ service {
337337
retryable_status_codes: ["kUnavailable"]
338338
}
339339

340+
service {
341+
service_proto_path: "google/cloud/bigquery/biglake/v1/metastore.proto"
342+
product_path: "google/cloud/bigquery/biglake/v1"
343+
initial_copyright_year: "2023"
344+
retryable_status_codes: ["kUnavailable"]
345+
}
346+
340347
service {
341348
service_proto_path: "google/cloud/bigquery/connection/v1/connection.proto"
342349
product_path: "google/cloud/bigquery/connection/v1"

google/cloud/bigquery/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ licenses(["notice"]) # Apache 2.0
1818

1919
service_dirs = [
2020
"",
21+
"biglake/v1/",
2122
"analyticshub/v1/",
2223
"connection/v1/",
2324
"datapolicies/v1/",
@@ -53,6 +54,7 @@ cc_library(
5354
"//:common",
5455
"//:grpc_utils",
5556
"@com_google_googleapis//google/cloud/bigquery/analyticshub/v1:analyticshub_cc_grpc",
57+
"@com_google_googleapis//google/cloud/bigquery/biglake/v1:biglake_cc_grpc",
5658
"@com_google_googleapis//google/cloud/bigquery/connection/v1:connection_cc_grpc",
5759
"@com_google_googleapis//google/cloud/bigquery/datapolicies/v1:datapolicies_cc_grpc",
5860
"@com_google_googleapis//google/cloud/bigquery/datatransfer/v1:datatransfer_cc_grpc",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"api_id": "biglake.googleapis.com",
3+
"api_shortname": "biglake",
4+
"client_documentation": "https://cloud.google.com/cpp/docs/reference/bigquery/latest",
5+
"distribution_name": "google-cloud-cpp",
6+
"issue_tracker": "https://issuetracker.google.com/issues?q=componentid:187149%20status=open",
7+
"language": "cpp",
8+
"library_type": "GAPIC_AUTO",
9+
"name_pretty": "BigLake API",
10+
"product_documentation": "https://cloud.google.com/bigquery/docs/iceberg-tables#create-using-biglake-metastore",
11+
"release_level": "stable",
12+
"repo": "googleapis/google-cloud-cpp",
13+
"requires_billing": true
14+
}
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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+
// https://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+
15+
// Generated by the Codegen C++ plugin.
16+
// If you make any local changes, they will be lost.
17+
// source: google/cloud/bigquery/biglake/v1/metastore.proto
18+
19+
#include "google/cloud/bigquery/biglake/v1/internal/metastore_auth_decorator.h"
20+
#include <google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h>
21+
#include <memory>
22+
23+
namespace google {
24+
namespace cloud {
25+
namespace bigquery_biglake_v1_internal {
26+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
27+
28+
MetastoreServiceAuth::MetastoreServiceAuth(
29+
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth,
30+
std::shared_ptr<MetastoreServiceStub> child)
31+
: auth_(std::move(auth)), child_(std::move(child)) {}
32+
33+
StatusOr<google::cloud::bigquery::biglake::v1::Catalog>
34+
MetastoreServiceAuth::CreateCatalog(
35+
grpc::ClientContext& context,
36+
google::cloud::bigquery::biglake::v1::CreateCatalogRequest const& request) {
37+
auto status = auth_->ConfigureContext(context);
38+
if (!status.ok()) return status;
39+
return child_->CreateCatalog(context, request);
40+
}
41+
42+
StatusOr<google::cloud::bigquery::biglake::v1::Catalog>
43+
MetastoreServiceAuth::DeleteCatalog(
44+
grpc::ClientContext& context,
45+
google::cloud::bigquery::biglake::v1::DeleteCatalogRequest const& request) {
46+
auto status = auth_->ConfigureContext(context);
47+
if (!status.ok()) return status;
48+
return child_->DeleteCatalog(context, request);
49+
}
50+
51+
StatusOr<google::cloud::bigquery::biglake::v1::Catalog>
52+
MetastoreServiceAuth::GetCatalog(
53+
grpc::ClientContext& context,
54+
google::cloud::bigquery::biglake::v1::GetCatalogRequest const& request) {
55+
auto status = auth_->ConfigureContext(context);
56+
if (!status.ok()) return status;
57+
return child_->GetCatalog(context, request);
58+
}
59+
60+
StatusOr<google::cloud::bigquery::biglake::v1::ListCatalogsResponse>
61+
MetastoreServiceAuth::ListCatalogs(
62+
grpc::ClientContext& context,
63+
google::cloud::bigquery::biglake::v1::ListCatalogsRequest const& request) {
64+
auto status = auth_->ConfigureContext(context);
65+
if (!status.ok()) return status;
66+
return child_->ListCatalogs(context, request);
67+
}
68+
69+
StatusOr<google::cloud::bigquery::biglake::v1::Database>
70+
MetastoreServiceAuth::CreateDatabase(
71+
grpc::ClientContext& context,
72+
google::cloud::bigquery::biglake::v1::CreateDatabaseRequest const&
73+
request) {
74+
auto status = auth_->ConfigureContext(context);
75+
if (!status.ok()) return status;
76+
return child_->CreateDatabase(context, request);
77+
}
78+
79+
StatusOr<google::cloud::bigquery::biglake::v1::Database>
80+
MetastoreServiceAuth::DeleteDatabase(
81+
grpc::ClientContext& context,
82+
google::cloud::bigquery::biglake::v1::DeleteDatabaseRequest const&
83+
request) {
84+
auto status = auth_->ConfigureContext(context);
85+
if (!status.ok()) return status;
86+
return child_->DeleteDatabase(context, request);
87+
}
88+
89+
StatusOr<google::cloud::bigquery::biglake::v1::Database>
90+
MetastoreServiceAuth::UpdateDatabase(
91+
grpc::ClientContext& context,
92+
google::cloud::bigquery::biglake::v1::UpdateDatabaseRequest const&
93+
request) {
94+
auto status = auth_->ConfigureContext(context);
95+
if (!status.ok()) return status;
96+
return child_->UpdateDatabase(context, request);
97+
}
98+
99+
StatusOr<google::cloud::bigquery::biglake::v1::Database>
100+
MetastoreServiceAuth::GetDatabase(
101+
grpc::ClientContext& context,
102+
google::cloud::bigquery::biglake::v1::GetDatabaseRequest const& request) {
103+
auto status = auth_->ConfigureContext(context);
104+
if (!status.ok()) return status;
105+
return child_->GetDatabase(context, request);
106+
}
107+
108+
StatusOr<google::cloud::bigquery::biglake::v1::ListDatabasesResponse>
109+
MetastoreServiceAuth::ListDatabases(
110+
grpc::ClientContext& context,
111+
google::cloud::bigquery::biglake::v1::ListDatabasesRequest const& request) {
112+
auto status = auth_->ConfigureContext(context);
113+
if (!status.ok()) return status;
114+
return child_->ListDatabases(context, request);
115+
}
116+
117+
StatusOr<google::cloud::bigquery::biglake::v1::Table>
118+
MetastoreServiceAuth::CreateTable(
119+
grpc::ClientContext& context,
120+
google::cloud::bigquery::biglake::v1::CreateTableRequest const& request) {
121+
auto status = auth_->ConfigureContext(context);
122+
if (!status.ok()) return status;
123+
return child_->CreateTable(context, request);
124+
}
125+
126+
StatusOr<google::cloud::bigquery::biglake::v1::Table>
127+
MetastoreServiceAuth::DeleteTable(
128+
grpc::ClientContext& context,
129+
google::cloud::bigquery::biglake::v1::DeleteTableRequest const& request) {
130+
auto status = auth_->ConfigureContext(context);
131+
if (!status.ok()) return status;
132+
return child_->DeleteTable(context, request);
133+
}
134+
135+
StatusOr<google::cloud::bigquery::biglake::v1::Table>
136+
MetastoreServiceAuth::UpdateTable(
137+
grpc::ClientContext& context,
138+
google::cloud::bigquery::biglake::v1::UpdateTableRequest const& request) {
139+
auto status = auth_->ConfigureContext(context);
140+
if (!status.ok()) return status;
141+
return child_->UpdateTable(context, request);
142+
}
143+
144+
StatusOr<google::cloud::bigquery::biglake::v1::Table>
145+
MetastoreServiceAuth::RenameTable(
146+
grpc::ClientContext& context,
147+
google::cloud::bigquery::biglake::v1::RenameTableRequest const& request) {
148+
auto status = auth_->ConfigureContext(context);
149+
if (!status.ok()) return status;
150+
return child_->RenameTable(context, request);
151+
}
152+
153+
StatusOr<google::cloud::bigquery::biglake::v1::Table>
154+
MetastoreServiceAuth::GetTable(
155+
grpc::ClientContext& context,
156+
google::cloud::bigquery::biglake::v1::GetTableRequest const& request) {
157+
auto status = auth_->ConfigureContext(context);
158+
if (!status.ok()) return status;
159+
return child_->GetTable(context, request);
160+
}
161+
162+
StatusOr<google::cloud::bigquery::biglake::v1::ListTablesResponse>
163+
MetastoreServiceAuth::ListTables(
164+
grpc::ClientContext& context,
165+
google::cloud::bigquery::biglake::v1::ListTablesRequest const& request) {
166+
auto status = auth_->ConfigureContext(context);
167+
if (!status.ok()) return status;
168+
return child_->ListTables(context, request);
169+
}
170+
171+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
172+
} // namespace bigquery_biglake_v1_internal
173+
} // namespace cloud
174+
} // namespace google
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
// https://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+
15+
// Generated by the Codegen C++ plugin.
16+
// If you make any local changes, they will be lost.
17+
// source: google/cloud/bigquery/biglake/v1/metastore.proto
18+
19+
#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H
20+
#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H
21+
22+
#include "google/cloud/bigquery/biglake/v1/internal/metastore_stub.h"
23+
#include "google/cloud/internal/unified_grpc_credentials.h"
24+
#include "google/cloud/version.h"
25+
#include <memory>
26+
#include <set>
27+
#include <string>
28+
29+
namespace google {
30+
namespace cloud {
31+
namespace bigquery_biglake_v1_internal {
32+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
33+
34+
class MetastoreServiceAuth : public MetastoreServiceStub {
35+
public:
36+
~MetastoreServiceAuth() override = default;
37+
MetastoreServiceAuth(
38+
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth,
39+
std::shared_ptr<MetastoreServiceStub> child);
40+
41+
StatusOr<google::cloud::bigquery::biglake::v1::Catalog> CreateCatalog(
42+
grpc::ClientContext& context,
43+
google::cloud::bigquery::biglake::v1::CreateCatalogRequest const& request)
44+
override;
45+
46+
StatusOr<google::cloud::bigquery::biglake::v1::Catalog> DeleteCatalog(
47+
grpc::ClientContext& context,
48+
google::cloud::bigquery::biglake::v1::DeleteCatalogRequest const& request)
49+
override;
50+
51+
StatusOr<google::cloud::bigquery::biglake::v1::Catalog> GetCatalog(
52+
grpc::ClientContext& context,
53+
google::cloud::bigquery::biglake::v1::GetCatalogRequest const& request)
54+
override;
55+
56+
StatusOr<google::cloud::bigquery::biglake::v1::ListCatalogsResponse>
57+
ListCatalogs(grpc::ClientContext& context,
58+
google::cloud::bigquery::biglake::v1::ListCatalogsRequest const&
59+
request) override;
60+
61+
StatusOr<google::cloud::bigquery::biglake::v1::Database> CreateDatabase(
62+
grpc::ClientContext& context,
63+
google::cloud::bigquery::biglake::v1::CreateDatabaseRequest const&
64+
request) override;
65+
66+
StatusOr<google::cloud::bigquery::biglake::v1::Database> DeleteDatabase(
67+
grpc::ClientContext& context,
68+
google::cloud::bigquery::biglake::v1::DeleteDatabaseRequest const&
69+
request) override;
70+
71+
StatusOr<google::cloud::bigquery::biglake::v1::Database> UpdateDatabase(
72+
grpc::ClientContext& context,
73+
google::cloud::bigquery::biglake::v1::UpdateDatabaseRequest const&
74+
request) override;
75+
76+
StatusOr<google::cloud::bigquery::biglake::v1::Database> GetDatabase(
77+
grpc::ClientContext& context,
78+
google::cloud::bigquery::biglake::v1::GetDatabaseRequest const& request)
79+
override;
80+
81+
StatusOr<google::cloud::bigquery::biglake::v1::ListDatabasesResponse>
82+
ListDatabases(
83+
grpc::ClientContext& context,
84+
google::cloud::bigquery::biglake::v1::ListDatabasesRequest const& request)
85+
override;
86+
87+
StatusOr<google::cloud::bigquery::biglake::v1::Table> CreateTable(
88+
grpc::ClientContext& context,
89+
google::cloud::bigquery::biglake::v1::CreateTableRequest const& request)
90+
override;
91+
92+
StatusOr<google::cloud::bigquery::biglake::v1::Table> DeleteTable(
93+
grpc::ClientContext& context,
94+
google::cloud::bigquery::biglake::v1::DeleteTableRequest const& request)
95+
override;
96+
97+
StatusOr<google::cloud::bigquery::biglake::v1::Table> UpdateTable(
98+
grpc::ClientContext& context,
99+
google::cloud::bigquery::biglake::v1::UpdateTableRequest const& request)
100+
override;
101+
102+
StatusOr<google::cloud::bigquery::biglake::v1::Table> RenameTable(
103+
grpc::ClientContext& context,
104+
google::cloud::bigquery::biglake::v1::RenameTableRequest const& request)
105+
override;
106+
107+
StatusOr<google::cloud::bigquery::biglake::v1::Table> GetTable(
108+
grpc::ClientContext& context,
109+
google::cloud::bigquery::biglake::v1::GetTableRequest const& request)
110+
override;
111+
112+
StatusOr<google::cloud::bigquery::biglake::v1::ListTablesResponse> ListTables(
113+
grpc::ClientContext& context,
114+
google::cloud::bigquery::biglake::v1::ListTablesRequest const& request)
115+
override;
116+
117+
private:
118+
std::shared_ptr<google::cloud::internal::GrpcAuthenticationStrategy> auth_;
119+
std::shared_ptr<MetastoreServiceStub> child_;
120+
};
121+
122+
GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
123+
} // namespace bigquery_biglake_v1_internal
124+
} // namespace cloud
125+
} // namespace google
126+
127+
#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_BIGQUERY_BIGLAKE_V1_INTERNAL_METASTORE_AUTH_DECORATOR_H

0 commit comments

Comments
 (0)