Skip to content

Commit

Permalink
feat: Update MS API stubs with Unified API (#5548)
Browse files Browse the repository at this point in the history
* feat: Update MS API stubs with Unified API
docs: A comment for field `name` in message `.google.cloud.bigquery.migration.v2.MigrationWorkflow` is changed to include 'Identifier'
docs: A comment for field `translation_config_details` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is changed
docs: A comment for field `type` in message `.google.cloud.bigquery.migration.v2.MigrationTask` is changed to include new supported types

PiperOrigin-RevId: 651876892

Source-Link: googleapis/googleapis@aa3a96b

Source-Link: googleapis/googleapis-gen@a939b7b
Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJpZ3F1ZXJ5LW1pZ3JhdGlvbi8uT3dsQm90LnlhbWwiLCJoIjoiYTkzOWI3YjM0YTViMzVkNGJmNmIxYjU1YTI1NzRmN2Q5MzgxMGFiNiJ9

* 🦉 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>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Jul 17, 2024
1 parent 09bc034 commit 9bd3923
Show file tree
Hide file tree
Showing 9 changed files with 9,327 additions and 3,392 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import "google/api/resource.proto";
import "google/cloud/bigquery/migration/v2/migration_error_details.proto";
import "google/cloud/bigquery/migration/v2/migration_metrics.proto";
import "google/cloud/bigquery/migration/v2/translation_config.proto";
import "google/cloud/bigquery/migration/v2/translation_details.proto";
import "google/cloud/bigquery/migration/v2/translation_usability.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/error_details.proto";

Expand Down Expand Up @@ -61,13 +63,14 @@ message MigrationWorkflow {
COMPLETED = 4;
}

// Output only. Immutable. The unique identifier for the migration workflow.
// The ID is server-generated.
// Output only. Immutable. Identifier. The unique identifier for the migration
// workflow. The ID is server-generated.
//
// Example: `projects/123/locations/us/workflows/345`
string name = 1 [
(google.api.field_behavior) = OUTPUT_ONLY,
(google.api.field_behavior) = IMMUTABLE
(google.api.field_behavior) = IMMUTABLE,
(google.api.field_behavior) = IDENTIFIER
];

// The display name of the workflow. This can be set to give a workflow
Expand Down Expand Up @@ -119,8 +122,11 @@ message MigrationTask {

// The details of the task.
oneof task_details {
// Task configuration for Batch SQL Translation.
// Task configuration for CW Batch/Offline SQL Translation.
TranslationConfigDetails translation_config_details = 14;

// Task details for unified SQL Translation.
TranslationDetails translation_details = 16;
}

// Output only. Immutable. The unique identifier for the migration task. The
Expand All @@ -136,7 +142,7 @@ message MigrationTask {
// Translation_Snowflake2BQ, Translation_Netezza2BQ,
// Translation_AzureSynapse2BQ, Translation_Vertica2BQ,
// Translation_SQLServer2BQ, Translation_Presto2BQ, Translation_MySQL2BQ,
// Translation_Postgresql2BQ.
// Translation_Postgresql2BQ, Translation_SQLite2BQ, Translation_Greenplum2BQ.
string type = 2;

// Output only. The current state of the task.
Expand All @@ -152,6 +158,31 @@ message MigrationTask {

// Time when the task was last updated.
google.protobuf.Timestamp last_update_time = 7;

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

// The number or resources with errors. Note: This is not the total
// number of errors as each resource can have more than one error.
// This is used to indicate truncation by having a `resource_error_count`
// that is higher than the size of `resource_error_details`.
int32 resource_error_count = 18;

// The metrics for the task.
repeated TimeSeries metrics = 19;

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

// Count of all the processing errors in this task and its subtasks.
int32 total_processing_error_count = 21;

// Count of all the resource errors in this task and its subtasks.
int32 total_resource_error_count = 22;
}

// A subtask for a migration which carries details about the configuration of
Expand Down Expand Up @@ -236,3 +267,21 @@ message MigrationSubtask {
// The metrics for the subtask.
repeated TimeSeries metrics = 11;
}

// The migration task result.
message MigrationTaskResult {
// Details specific to the task type.
oneof details {
// Details specific to translation task types.
TranslationTaskResult translation_task_result = 2;
}
}

// Translation specific result details from the migration task.
message TranslationTaskResult {
// The list of the translated literals.
repeated Literal translated_literals = 1;

// The records from the aggregate CSV report for a migration workflow.
repeated GcsReportLogMessage report_log_messages = 2;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ syntax = "proto3";

package google.cloud.bigquery.migration.v2;

import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2";
option go_package = "cloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpb";
option java_multiple_files = true;
Expand Down Expand Up @@ -56,6 +58,12 @@ message TranslationConfigDetails {

// The indicator to show translation request initiator.
string request_source = 8;

// The types of output to generate, e.g. sql, metadata etc. If not specified,
// a default set of targets will be generated. Some additional target types
// may be slower to generate. See the documentation for the set of available
// target types.
repeated string target_types = 9;
}

// The possible dialect options for translation.
Expand Down Expand Up @@ -103,6 +111,15 @@ message Dialect {

// The MySQL dialect
MySQLDialect mysql_dialect = 14;

// DB2 dialect
DB2Dialect db2_dialect = 15;

// SQLite dialect
SQLiteDialect sqlite_dialect = 16;

// Greenplum dialect
GreenplumDialect greenplum_dialect = 17;
}
}

Expand Down Expand Up @@ -163,6 +180,15 @@ message PrestoDialect {}
// The dialect definition for MySQL.
message MySQLDialect {}

// The dialect definition for DB2.
message DB2Dialect {}

// The dialect definition for SQLite.
message SQLiteDialect {}

// The dialect definition for Greenplum.
message GreenplumDialect {}

// Represents a map of name mappings using a list of key:value proto messages of
// existing name to desired output name.
message ObjectNameMappingList {
Expand Down Expand Up @@ -257,4 +283,12 @@ message SourceEnv {
// The schema search path. When SQL objects are missing schema name,
// translation engine will search through this list to find the value.
repeated string schema_search_path = 2;

// Optional. Expects a valid BigQuery dataset ID that exists, e.g.,
// project-123.metadata_store_123. If specified, translation will search and
// read the required schema information from a metadata store in this dataset.
// If metadata store doesn't exist, translation will parse the metadata file
// and upload the schema info to a temp table in the dataset to speed up
// future translation jobs.
string metadata_store_dataset = 3 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
// Copyright 2024 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.migration.v2;

import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2";
option go_package = "cloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpb";
option java_multiple_files = true;
option java_outer_classname = "TranslationDetailsProto";
option java_package = "com.google.cloud.bigquery.migration.v2";
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";

// The translation details to capture the necessary settings for a translation
// job.
message TranslationDetails {
// The mapping from source to target SQL.
repeated SourceTargetMapping source_target_mapping = 1;

// The base URI for all writes to persistent storage.
string target_base_uri = 2;

// The default source environment values for the translation.
SourceEnvironment source_environment = 3;

// The list of literal targets that will be directly returned to the response.
// Each entry consists of the constructed path, EXCLUDING the base path. Not
// providing a target_base_uri will prevent writing to persistent storage.
repeated string target_return_literals = 4;

// The types of output to generate, e.g. sql, metadata,
// lineage_from_sql_scripts, etc. If not specified, a default set of
// targets will be generated. Some additional target types may be slower to
// generate. See the documentation for the set of available target types.
repeated string target_types = 5;
}

// Represents one mapping from a source SQL to a target SQL.
message SourceTargetMapping {
// The source SQL or the path to it.
SourceSpec source_spec = 1;

// The target SQL or the path for it.
TargetSpec target_spec = 2;
}

// Represents one path to the location that holds source data.
message SourceSpec {
// The specific source SQL.
oneof source {
// The base URI for all files to be read in as sources for translation.
string base_uri = 1;

// Source literal.
Literal literal = 2;
}

// Optional. The optional field to specify the encoding of the sql bytes.
string encoding = 3 [(google.api.field_behavior) = OPTIONAL];
}

// Represents one path to the location that holds target data.
message TargetSpec {
// The relative path for the target data. Given source file
// `base_uri/input/sql`, the output would be
// `target_base_uri/sql/relative_path/input.sql`.
string relative_path = 1;
}

// Literal data.
message Literal {
// The literal SQL contents.
oneof literal_data {
// Literal string data.
string literal_string = 2;

// Literal byte data.
bytes literal_bytes = 3;
}

// Required. The identifier of the literal entry.
string relative_path = 1 [(google.api.field_behavior) = REQUIRED];
}

// Represents the default source environment values for the translation.
message SourceEnvironment {
// The default database name to fully qualify SQL objects when their database
// name is missing.
string default_database = 1;

// The schema search path. When SQL objects are missing schema name,
// translation engine will search through this list to find the value.
repeated string schema_search_path = 2;

// Optional. Expects a validQ BigQuery dataset ID that exists, e.g.,
// project-123.metadata_store_123. If specified, translation will search and
// read the required schema information from a metadata store in this dataset.
// If metadata store doesn't exist, translation will parse the metadata file
// and upload the schema info to a temp table in the dataset to speed up
// future translation jobs.
string metadata_store_dataset = 3 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Copyright 2024 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.migration.v2;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";

option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2";
option go_package = "cloud.google.com/go/bigquery/migration/apiv2/migrationpb;migrationpb";
option java_multiple_files = true;
option java_outer_classname = "TranslationSuggestionProto";
option java_package = "com.google.cloud.bigquery.migration.v2";
option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";

// Details about a record.
message TranslationReportRecord {
// The severity type of the record.
enum Severity {
// SeverityType not specified.
SEVERITY_UNSPECIFIED = 0;

// INFO type.
INFO = 1;

// WARNING type. The translated query may still provide useful information
// if all the report records are WARNING.
WARNING = 2;

// ERROR type. Translation failed.
ERROR = 3;
}

// Severity of the translation record.
Severity severity = 1;

// Specifies the row from the source text where the error occurred (0 based).
// Example: 2
int32 script_line = 2;

// Specifies the column from the source texts where the error occurred. (0
// based) example: 6
int32 script_column = 3;

// Category of the error/warning. Example: SyntaxError
string category = 4;

// Detailed message of the record.
string message = 5;
}
Loading

0 comments on commit 9bd3923

Please sign in to comment.