Skip to content

Commit 43731d5

Browse files
Google APIscopybara-github
authored andcommitted
feat: add support for assessment tasks in BigQuery Migration API
feat: add suggestion config to translation tasks docs: update comments for various fields in MigrationWorkflow, MigrationTask, and MigrationSubtask docs: Add comment that field `create_time` in message `.google.cloud.bigquery.migration.v2.MigrationWorkflow` is output only docs: Add comment that field `last_update_time` in message `.google.cloud.bigquery.migration.v2.MigrationWorkflow` is output only docs: Fixed typo in comment for enum value `PAUSED` in enum `State` is changed docs: Link to relevant documentation in comment for field `type` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is changed docs: Add comment that field `create_time` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is output only docs: Add comment that field `last_update_time` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is output only docs: Add comment that field `resource_error_count` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is output only docs: Add comment that field `metrics` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is output only docs: Add comment that field `total_processing_error_count` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is output only docs: Add comment that field `total_resource_error_count` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is output only docs: Add comment that field `resource_error_count` in message `.google.cloud.bigquery.migration.v2.MigrationSubtask` is output only docs: Add comment that field `create_time` in message `.google.cloud.bigquery.migration.v2.MigrationSubtask` is output only docs: Add comment that field `last_update_time` in message `.google.cloud.bigquery.migration.v2.MigrationSubtask` is output only docs: Add comment for field `metrics` in message `.google.cloud.bigquery.migration.v2.MigrationSubtask` is output only PiperOrigin-RevId: 918496010
1 parent 3579f1c commit 43731d5

10 files changed

Lines changed: 172 additions & 50 deletions

google/cloud/bigquery/migration/v2/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ load("@rules_proto//proto:defs.bzl", "proto_library")
2424
proto_library(
2525
name = "migration_proto",
2626
srcs = [
27+
"assessment_task.proto",
2728
"migration_entities.proto",
2829
"migration_error_details.proto",
2930
"migration_metrics.proto",
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Copyright 2026 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.bigquery.migration.v2;
18+
19+
import "google/api/field_behavior.proto";
20+
21+
option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2";
22+
option go_package = "cloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpb";
23+
option java_multiple_files = true;
24+
option java_outer_classname = "AssessmentTaskProto";
25+
option java_package = "com.google.cloud.bigquery.migration.v2";
26+
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";
27+
28+
// Assessment task config.
29+
message AssessmentTaskDetails {
30+
// Required. The Cloud Storage path for assessment input files.
31+
string input_path = 1 [(google.api.field_behavior) = REQUIRED];
32+
33+
// Required. The BigQuery dataset for output.
34+
string output_dataset = 2 [(google.api.field_behavior) = REQUIRED];
35+
36+
// Optional. An optional Cloud Storage path to write the query logs (which is
37+
// then used as an input path on the translation task)
38+
string querylogs_path = 3 [(google.api.field_behavior) = OPTIONAL];
39+
40+
// Required. The data source or data warehouse type (eg: TERADATA/REDSHIFT)
41+
// from which the input data is extracted.
42+
string data_source = 4 [(google.api.field_behavior) = REQUIRED];
43+
44+
// Optional. A collection of additional feature flags for this assessment.
45+
optional AssessmentFeatureHandle feature_handle = 6
46+
[(google.api.field_behavior) = OPTIONAL];
47+
}
48+
49+
// User-definable feature flags for assessment tasks.
50+
message AssessmentFeatureHandle {
51+
// Optional. Whether to create a dataset containing non-PII data in addition
52+
// to the output dataset.
53+
optional bool add_shareable_dataset = 1
54+
[(google.api.field_behavior) = OPTIONAL];
55+
}

google/cloud/bigquery/migration/v2/bigquerymigration_v2.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ documentation:
1111
The migration service, exposing apis for migration jobs operations, and
1212
agent management.
1313
14-
backend:
15-
rules:
16-
- selector: 'google.cloud.bigquery.migration.v2.MigrationService.*'
17-
deadline: 60.0
18-
1914
authentication:
2015
rules:
2116
- selector: 'google.cloud.bigquery.migration.v2.MigrationService.*'

google/cloud/bigquery/migration/v2/migration_entities.proto

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package google.cloud.bigquery.migration.v2;
1818

1919
import "google/api/field_behavior.proto";
2020
import "google/api/resource.proto";
21+
import "google/cloud/bigquery/migration/v2/assessment_task.proto";
2122
import "google/cloud/bigquery/migration/v2/migration_error_details.proto";
2223
import "google/cloud/bigquery/migration/v2/migration_metrics.proto";
2324
import "google/cloud/bigquery/migration/v2/translation_config.proto";
@@ -85,11 +86,13 @@ message MigrationWorkflow {
8586
// Output only. That status of the workflow.
8687
State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
8788

88-
// Time when the workflow was created.
89-
google.protobuf.Timestamp create_time = 4;
89+
// Output only. Time when the workflow was created.
90+
google.protobuf.Timestamp create_time = 4
91+
[(google.api.field_behavior) = OUTPUT_ONLY];
9092

91-
// Time when the workflow was last updated.
92-
google.protobuf.Timestamp last_update_time = 5;
93+
// Output only. Time when the workflow was last updated.
94+
google.protobuf.Timestamp last_update_time = 5
95+
[(google.api.field_behavior) = OUTPUT_ONLY];
9396
}
9497

9598
// A single task for a migration which has details about the configuration of
@@ -109,7 +112,7 @@ message MigrationTask {
109112
// The task is running, i.e. its subtasks are ready for execution.
110113
RUNNING = 3;
111114

112-
// Tha task is paused. Assigned subtasks can continue, but no new subtasks
115+
// The task is paused. Assigned subtasks can continue, but no new subtasks
113116
// will be scheduled.
114117
PAUSED = 4;
115118

@@ -122,6 +125,9 @@ message MigrationTask {
122125

123126
// The details of the task.
124127
oneof task_details {
128+
// Task configuration for Assessment.
129+
AssessmentTaskDetails assessment_task_details = 12;
130+
125131
// Task configuration for CW Batch/Offline SQL Translation.
126132
TranslationConfigDetails translation_config_details = 14;
127133

@@ -136,13 +142,22 @@ message MigrationTask {
136142
(google.api.field_behavior) = IMMUTABLE
137143
];
138144

139-
// The type of the task. This must be one of the supported task types:
140-
// Translation_Teradata2BQ, Translation_Redshift2BQ, Translation_Bteq2BQ,
141-
// Translation_Oracle2BQ, Translation_HiveQL2BQ, Translation_SparkSQL2BQ,
142-
// Translation_Snowflake2BQ, Translation_Netezza2BQ,
143-
// Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
144-
// Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ,
145-
// Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ.
145+
// The type of the task. This must be one of the supported task types.
146+
//
147+
// Assessment:
148+
//
149+
// - `Assessment_Hive` - Assessment for Hive.
150+
// - `Assessment_Redshift` - Assessment for Redshift.
151+
// - `Assessment_Snowflake` - Assessment for Snowflake.
152+
// - `Assessment_Teradata_v2` - Assessment for Teradata.
153+
// - `Assessment_Oracle` - Assessment for Oracle.
154+
// - `Assessment_Hadoop` - Assessment for Hadoop.
155+
// - `Assessment_Informatica` - Assessment for Informatica.
156+
//
157+
// Translation:
158+
// See [Supported Task
159+
// Types](https://docs.cloud.google.com/bigquery/docs/api-sql-translator#supported_task_types)
160+
// for a list of supported task types.
146161
string type = 2;
147162

148163
// Output only. The current state of the task.
@@ -153,36 +168,42 @@ message MigrationTask {
153168
google.rpc.ErrorInfo processing_error = 5
154169
[(google.api.field_behavior) = OUTPUT_ONLY];
155170

156-
// Time when the task was created.
157-
google.protobuf.Timestamp create_time = 6;
171+
// Output only. Time when the task was created.
172+
google.protobuf.Timestamp create_time = 6
173+
[(google.api.field_behavior) = OUTPUT_ONLY];
158174

159-
// Time when the task was last updated.
160-
google.protobuf.Timestamp last_update_time = 7;
175+
// Output only. Time when the task was last updated.
176+
google.protobuf.Timestamp last_update_time = 7
177+
[(google.api.field_behavior) = OUTPUT_ONLY];
161178

162179
// Output only. Provides details to errors and issues encountered while
163180
// processing the task. Presence of error details does not mean that the task
164181
// failed.
165182
repeated ResourceErrorDetail resource_error_details = 17
166183
[(google.api.field_behavior) = OUTPUT_ONLY];
167184

168-
// The number or resources with errors. Note: This is not the total
169-
// number of errors as each resource can have more than one error.
170-
// This is used to indicate truncation by having a `resource_error_count`
171-
// that is higher than the size of `resource_error_details`.
172-
int32 resource_error_count = 18;
185+
// Output only. The number or resources with errors. Note: This is not the
186+
// total number of errors as each resource can have more than one error. This
187+
// is used to indicate truncation by having a `resource_error_count` that is
188+
// higher than the size of `resource_error_details`.
189+
int32 resource_error_count = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
173190

174-
// The metrics for the task.
175-
repeated TimeSeries metrics = 19;
191+
// Output only. The metrics for the task.
192+
repeated TimeSeries metrics = 19 [(google.api.field_behavior) = OUTPUT_ONLY];
176193

177194
// Output only. The result of the task.
178195
MigrationTaskResult task_result = 20
179196
[(google.api.field_behavior) = OUTPUT_ONLY];
180197

181-
// Count of all the processing errors in this task and its subtasks.
182-
int32 total_processing_error_count = 21;
198+
// Output only. Count of all the processing errors in this task and its
199+
// subtasks.
200+
int32 total_processing_error_count = 21
201+
[(google.api.field_behavior) = OUTPUT_ONLY];
183202

184-
// Count of all the resource errors in this task and its subtasks.
185-
int32 total_resource_error_count = 22;
203+
// Output only. Count of all the resource errors in this task and its
204+
// subtasks.
205+
int32 total_resource_error_count = 22
206+
[(google.api.field_behavior) = OUTPUT_ONLY];
186207
}
187208

188209
// A subtask for a migration which carries details about the configuration of
@@ -252,20 +273,22 @@ message MigrationSubtask {
252273
repeated ResourceErrorDetail resource_error_details = 12
253274
[(google.api.field_behavior) = OUTPUT_ONLY];
254275

255-
// The number or resources with errors. Note: This is not the total
256-
// number of errors as each resource can have more than one error.
257-
// This is used to indicate truncation by having a `resource_error_count`
258-
// that is higher than the size of `resource_error_details`.
259-
int32 resource_error_count = 13;
276+
// Output only. The number or resources with errors. Note: This is not the
277+
// total number of errors as each resource can have more than one error. This
278+
// is used to indicate truncation by having a `resource_error_count` that is
279+
// higher than the size of `resource_error_details`.
280+
int32 resource_error_count = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
260281

261-
// Time when the subtask was created.
262-
google.protobuf.Timestamp create_time = 7;
282+
// Output only. Time when the subtask was created.
283+
google.protobuf.Timestamp create_time = 7
284+
[(google.api.field_behavior) = OUTPUT_ONLY];
263285

264-
// Time when the subtask was last updated.
265-
google.protobuf.Timestamp last_update_time = 8;
286+
// Output only. Time when the subtask was last updated.
287+
google.protobuf.Timestamp last_update_time = 8
288+
[(google.api.field_behavior) = OUTPUT_ONLY];
266289

267-
// The metrics for the subtask.
268-
repeated TimeSeries metrics = 11;
290+
// Output only. The metrics for the subtask.
291+
repeated TimeSeries metrics = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
269292
}
270293

271294
// The migration task result.
@@ -284,4 +307,7 @@ message TranslationTaskResult {
284307

285308
// The records from the aggregate CSV report for a migration workflow.
286309
repeated GcsReportLogMessage report_log_messages = 2;
310+
311+
// The Cloud Console URI for the migration workflow.
312+
string console_uri = 3;
287313
}

google/cloud/bigquery/migration/v2/migration_error_details.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/cloud/bigquery/migration/v2/migration_metrics.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/cloud/bigquery/migration/v2/migration_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/cloud/bigquery/migration/v2/translation_config.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/cloud/bigquery/migration/v2/translation_details.proto

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -47,6 +47,48 @@ message TranslationDetails {
4747
// targets will be generated. Some additional target types may be slower to
4848
// generate. See the documentation for the set of available target types.
4949
repeated string target_types = 5;
50+
51+
// The configuration for the suggestion if requested as a target type.
52+
SuggestionConfig suggestion_config = 6;
53+
}
54+
55+
// The configuration for the suggestion if requested as a target type.
56+
message SuggestionConfig {
57+
// The list of suggestion steps to skip.
58+
repeated SuggestionStep skip_suggestion_steps = 1;
59+
}
60+
61+
// Suggestion step to skip.
62+
message SuggestionStep {
63+
// Suggestion type.
64+
enum SuggestionType {
65+
// Suggestion type unspecified.
66+
SUGGESTION_TYPE_UNSPECIFIED = 0;
67+
68+
// Query customization.
69+
QUERY_CUSTOMIZATION = 1;
70+
71+
// Translation explanation.
72+
TRANSLATION_EXPLANATION = 2;
73+
}
74+
75+
// The target to apply the suggestion to.
76+
enum RewriteTarget {
77+
// Rewrite target unspecified.
78+
REWRITE_TARGET_UNSPECIFIED = 0;
79+
80+
// Source SQL.
81+
SOURCE_SQL = 1;
82+
83+
// Target SQL.
84+
TARGET_SQL = 2;
85+
}
86+
87+
// The type of suggestion.
88+
SuggestionType suggestion_type = 1;
89+
90+
// The rewrite target.
91+
RewriteTarget rewrite_target = 2;
5092
}
5193

5294
// Represents one mapping from a source SQL to a target SQL.
@@ -67,6 +109,9 @@ message SourceSpec {
67109

68110
// Source literal.
69111
Literal literal = 2;
112+
113+
// The path to a single source file in Cloud Storage.
114+
string gcs_file_path = 4;
70115
}
71116

72117
// Optional. The optional field to specify the encoding of the sql bytes.

google/cloud/bigquery/migration/v2/translation_usability.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2025 Google LLC
1+
// Copyright 2026 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)