Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kubikb/708e80523a6ba7de174ee5500d1b530d to your computer and use it in GitHub Desktop.
Save kubikb/708e80523a6ba7de174ee5500d1b530d to your computer and use it in GitHub Desktop.
Aliz BigQuery Batch Translation Service example
import json
from google.api_core.retry import Retry
import google.auth
from google.cloud import bigquery_migration_v2alpha
from google.oauth2 import service_account
from google.protobuf import any_pb2, json_format
import translation_pb2
project_id = "" # TODO: Set your GCP project ID
bucket_name = "" # TODO: Set your Cloud Storage bucket's name
migration_task_details_any = any_pb2.Any()
migration_task_details_contents = json.dumps({
"@type": "type.googleapis.com/google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails",
"input_path": f"gs://{bucket_name}/teradata_sql/ddl",
"output_path": f"gs://{bucket_name}/bigquery_standard_sql",
"file_encoding": "UTF_8"
})
migration_task_details_any = json_format.Parse(migration_task_details_contents, migration_task_details_any)
migration_service = bigquery_migration_v2alpha.MigrationServiceClient()
create_workflow_req = bigquery_migration_v2alpha.types.migration_service.CreateMigrationWorkflowRequest(
parent=f"projects/{project_id}/locations/us",
migration_workflow=bigquery_migration_v2alpha.types.MigrationWorkflow(
display_name="Aliz Translate SQL sample",
tasks={
"Aliz SQL Translate SQL": bigquery_migration_v2alpha.types.MigrationTask( # may be possible to pass multiple SQL translation tasks..
type_="Translation_Teradata",
details=migration_task_details_any
)
}
)
)
create_workflow = migration_service.create_migration_workflow(
request=create_workflow_req,
retry=Retry()
)
start_workflow = migration_service.start_migration_workflow(
request=bigquery_migration_v2alpha.types.StartMigrationWorkflowRequest(
name=create_workflow.name
),
retry=Retry()
)
print(create_workflow.name)
# 'projects/PROJECT_ID/locations/us/workflows/0c06e668-f3b9-4924-8f6e-3b4c639de9cb'
migration_workflow = migration_service.get_migration_workflow(
request=bigquery_migration_v2alpha.types.GetMigrationWorkflowRequest(
name=create_workflow.name
)
)
print(migration_workflow.state.name)
# COMPLETED
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: translation.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='translation.proto',
package='google.cloud.bigquery.migration.tasks.translation.v2alpha',
syntax='proto3',
serialized_options=b'\n=com.google.cloud.bigquery.migration.tasks.translation.v2alphaB\020TranslationProtoP\001Zdgoogle.golang.org/genproto/googleapis/cloud/bigquery/migration/tasks/translation/v2alpha;translation\252\0029Google.Cloud.BigQuery.Migration.Tasks.Translation.V2Alpha\312\0029Google\\Cloud\\BigQuery\\Migration\\Tasks\\Translation\\V2alpha',
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n\x11translation.proto\x12\x39google.cloud.bigquery.migration.tasks.translation.v2alpha\"A\n\x16TranslationFileMapping\x12\x12\n\ninput_path\x18\x01 \x01(\t\x12\x13\n\x0boutput_path\x18\x02 \x01(\t\"\x8b\n\n\x16TranslationTaskDetails\x12\x12\n\ninput_path\x18\x01 \x01(\t\x12\x13\n\x0boutput_path\x18\x02 \x01(\t\x12\x65\n\nfile_paths\x18\x0c \x03(\x0b\x32Q.google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationFileMapping\x12\x13\n\x0bschema_path\x18\x03 \x01(\t\x12u\n\rfile_encoding\x18\x04 \x01(\x0e\x32^.google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.FileEncoding\x12j\n\x13identifier_settings\x18\x05 \x01(\x0b\x32M.google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings\x12\x81\x01\n\x11special_token_map\x18\x06 \x03(\x0b\x32\x66.google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.SpecialTokenMapEntry\x12Q\n\x06\x66ilter\x18\x07 \x01(\x0b\x32\x41.google.cloud.bigquery.migration.tasks.translation.v2alpha.Filter\x12\x66\n\x10teradata_options\x18\n \x01(\x0b\x32J.google.cloud.bigquery.migration.tasks.translation.v2alpha.TeradataOptionsH\x00\x12^\n\x0c\x62teq_options\x18\x0b \x01(\x0b\x32\x46.google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptionsH\x00\x12#\n\x1btranslation_exception_table\x18\r \x01(\t\x1a\x93\x01\n\x14SpecialTokenMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12j\n\x05value\x18\x02 \x01(\x0e\x32[.google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.TokenType:\x02\x38\x01\"~\n\x0c\x46ileEncoding\x12\x1d\n\x19\x46ILE_ENCODING_UNSPECIFIED\x10\x00\x12\t\n\x05UTF_8\x10\x01\x12\x0e\n\nISO_8859_1\x10\x02\x12\x0c\n\x08US_ASCII\x10\x03\x12\n\n\x06UTF_16\x10\x04\x12\x0c\n\x08UTF_16LE\x10\x05\x12\x0c\n\x08UTF_16BE\x10\x06\"{\n\tTokenType\x12\x1a\n\x16TOKEN_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06STRING\x10\x01\x12\t\n\x05INT64\x10\x02\x12\x0b\n\x07NUMERIC\x10\x03\x12\x08\n\x04\x42OOL\x10\x04\x12\x0b\n\x07\x46LOAT64\x10\x05\x12\x08\n\x04\x44\x41TE\x10\x06\x12\r\n\tTIMESTAMP\x10\x07\x42\x12\n\x10language_options\"/\n\x06\x46ilter\x12%\n\x1dinput_file_exclusion_prefixes\x18\x01 \x03(\t\"\xcd\x03\n\x12IdentifierSettings\x12|\n\x16output_identifier_case\x18\x01 \x01(\x0e\x32\\.google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings.IdentifierCase\x12\x84\x01\n\x17identifier_rewrite_mode\x18\x02 \x01(\x0e\x32\x63.google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings.IdentifierRewriteMode\"U\n\x0eIdentifierCase\x12\x1f\n\x1bIDENTIFIER_CASE_UNSPECIFIED\x10\x00\x12\x0c\n\x08ORIGINAL\x10\x01\x12\t\n\x05UPPER\x10\x02\x12\t\n\x05LOWER\x10\x03\"[\n\x15IdentifierRewriteMode\x12\'\n#IDENTIFIER_REWRITE_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0f\n\x0bREWRITE_ALL\x10\x02\"\x11\n\x0fTeradataOptions\":\n\x10\x44\x61tasetReference\x12\x12\n\ndataset_id\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\"\xc6\x02\n\x0b\x42teqOptions\x12\x64\n\x0fproject_dataset\x18\x01 \x01(\x0b\x32K.google.cloud.bigquery.migration.tasks.translation.v2alpha.DatasetReference\x12\x18\n\x10\x64\x65\x66\x61ult_path_uri\x18\x02 \x01(\t\x12|\n\x14\x66ile_replacement_map\x18\x03 \x03(\x0b\x32^.google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.FileReplacementMapEntry\x1a\x39\n\x17\x46ileReplacementMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\xb1\x02\n=com.google.cloud.bigquery.migration.tasks.translation.v2alphaB\x10TranslationProtoP\x01Zdgoogle.golang.org/genproto/googleapis/cloud/bigquery/migration/tasks/translation/v2alpha;translation\xaa\x02\x39Google.Cloud.BigQuery.Migration.Tasks.Translation.V2Alpha\xca\x02\x39Google\\Cloud\\BigQuery\\Migration\\Tasks\\Translation\\V2alphab\x06proto3'
)
_TRANSLATIONTASKDETAILS_FILEENCODING = _descriptor.EnumDescriptor(
name='FileEncoding',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.FileEncoding',
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='FILE_ENCODING_UNSPECIFIED', index=0, number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='UTF_8', index=1, number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='ISO_8859_1', index=2, number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='US_ASCII', index=3, number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='UTF_16', index=4, number=4,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='UTF_16LE', index=5, number=5,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='UTF_16BE', index=6, number=6,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
],
containing_type=None,
serialized_options=None,
serialized_start=1168,
serialized_end=1294,
)
_sym_db.RegisterEnumDescriptor(_TRANSLATIONTASKDETAILS_FILEENCODING)
_TRANSLATIONTASKDETAILS_TOKENTYPE = _descriptor.EnumDescriptor(
name='TokenType',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.TokenType',
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='TOKEN_TYPE_UNSPECIFIED', index=0, number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='STRING', index=1, number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='INT64', index=2, number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='NUMERIC', index=3, number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='BOOL', index=4, number=4,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='FLOAT64', index=5, number=5,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='DATE', index=6, number=6,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='TIMESTAMP', index=7, number=7,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
],
containing_type=None,
serialized_options=None,
serialized_start=1296,
serialized_end=1419,
)
_sym_db.RegisterEnumDescriptor(_TRANSLATIONTASKDETAILS_TOKENTYPE)
_IDENTIFIERSETTINGS_IDENTIFIERCASE = _descriptor.EnumDescriptor(
name='IdentifierCase',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings.IdentifierCase',
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='IDENTIFIER_CASE_UNSPECIFIED', index=0, number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='ORIGINAL', index=1, number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='UPPER', index=2, number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='LOWER', index=3, number=3,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
],
containing_type=None,
serialized_options=None,
serialized_start=1774,
serialized_end=1859,
)
_sym_db.RegisterEnumDescriptor(_IDENTIFIERSETTINGS_IDENTIFIERCASE)
_IDENTIFIERSETTINGS_IDENTIFIERREWRITEMODE = _descriptor.EnumDescriptor(
name='IdentifierRewriteMode',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings.IdentifierRewriteMode',
filename=None,
file=DESCRIPTOR,
create_key=_descriptor._internal_create_key,
values=[
_descriptor.EnumValueDescriptor(
name='IDENTIFIER_REWRITE_MODE_UNSPECIFIED', index=0, number=0,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='NONE', index=1, number=1,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
_descriptor.EnumValueDescriptor(
name='REWRITE_ALL', index=2, number=2,
serialized_options=None,
type=None,
create_key=_descriptor._internal_create_key),
],
containing_type=None,
serialized_options=None,
serialized_start=1861,
serialized_end=1952,
)
_sym_db.RegisterEnumDescriptor(_IDENTIFIERSETTINGS_IDENTIFIERREWRITEMODE)
_TRANSLATIONFILEMAPPING = _descriptor.Descriptor(
name='TranslationFileMapping',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationFileMapping',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='input_path', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationFileMapping.input_path', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='output_path', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationFileMapping.output_path', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=80,
serialized_end=145,
)
_TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY = _descriptor.Descriptor(
name='SpecialTokenMapEntry',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.SpecialTokenMapEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.SpecialTokenMapEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='value', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.SpecialTokenMapEntry.value', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=b'8\001',
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1019,
serialized_end=1166,
)
_TRANSLATIONTASKDETAILS = _descriptor.Descriptor(
name='TranslationTaskDetails',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='input_path', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.input_path', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='output_path', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.output_path', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='file_paths', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.file_paths', index=2,
number=12, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='schema_path', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.schema_path', index=3,
number=3, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='file_encoding', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.file_encoding', index=4,
number=4, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='identifier_settings', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.identifier_settings', index=5,
number=5, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='special_token_map', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.special_token_map', index=6,
number=6, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='filter', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.filter', index=7,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='teradata_options', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.teradata_options', index=8,
number=10, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='bteq_options', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.bteq_options', index=9,
number=11, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='translation_exception_table', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.translation_exception_table', index=10,
number=13, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[_TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY, ],
enum_types=[
_TRANSLATIONTASKDETAILS_FILEENCODING,
_TRANSLATIONTASKDETAILS_TOKENTYPE,
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
_descriptor.OneofDescriptor(
name='language_options', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.language_options',
index=0, containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[]),
],
serialized_start=148,
serialized_end=1439,
)
_FILTER = _descriptor.Descriptor(
name='Filter',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.Filter',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='input_file_exclusion_prefixes', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.Filter.input_file_exclusion_prefixes', index=0,
number=1, type=9, cpp_type=9, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1441,
serialized_end=1488,
)
_IDENTIFIERSETTINGS = _descriptor.Descriptor(
name='IdentifierSettings',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='output_identifier_case', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings.output_identifier_case', index=0,
number=1, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='identifier_rewrite_mode', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings.identifier_rewrite_mode', index=1,
number=2, type=14, cpp_type=8, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
_IDENTIFIERSETTINGS_IDENTIFIERCASE,
_IDENTIFIERSETTINGS_IDENTIFIERREWRITEMODE,
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1491,
serialized_end=1952,
)
_TERADATAOPTIONS = _descriptor.Descriptor(
name='TeradataOptions',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.TeradataOptions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1954,
serialized_end=1971,
)
_DATASETREFERENCE = _descriptor.Descriptor(
name='DatasetReference',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.DatasetReference',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='dataset_id', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.DatasetReference.dataset_id', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='project_id', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.DatasetReference.project_id', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=1973,
serialized_end=2031,
)
_BTEQOPTIONS_FILEREPLACEMENTMAPENTRY = _descriptor.Descriptor(
name='FileReplacementMapEntry',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.FileReplacementMapEntry',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='key', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.FileReplacementMapEntry.key', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='value', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.FileReplacementMapEntry.value', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=b'8\001',
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2303,
serialized_end=2360,
)
_BTEQOPTIONS = _descriptor.Descriptor(
name='BteqOptions',
full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='project_dataset', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.project_dataset', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='default_path_uri', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.default_path_uri', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=b"".decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='file_replacement_map', full_name='google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.file_replacement_map', index=2,
number=3, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[_BTEQOPTIONS_FILEREPLACEMENTMAPENTRY, ],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=2034,
serialized_end=2360,
)
_TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY.fields_by_name['value'].enum_type = _TRANSLATIONTASKDETAILS_TOKENTYPE
_TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY.containing_type = _TRANSLATIONTASKDETAILS
_TRANSLATIONTASKDETAILS.fields_by_name['file_paths'].message_type = _TRANSLATIONFILEMAPPING
_TRANSLATIONTASKDETAILS.fields_by_name['file_encoding'].enum_type = _TRANSLATIONTASKDETAILS_FILEENCODING
_TRANSLATIONTASKDETAILS.fields_by_name['identifier_settings'].message_type = _IDENTIFIERSETTINGS
_TRANSLATIONTASKDETAILS.fields_by_name['special_token_map'].message_type = _TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY
_TRANSLATIONTASKDETAILS.fields_by_name['filter'].message_type = _FILTER
_TRANSLATIONTASKDETAILS.fields_by_name['teradata_options'].message_type = _TERADATAOPTIONS
_TRANSLATIONTASKDETAILS.fields_by_name['bteq_options'].message_type = _BTEQOPTIONS
_TRANSLATIONTASKDETAILS_FILEENCODING.containing_type = _TRANSLATIONTASKDETAILS
_TRANSLATIONTASKDETAILS_TOKENTYPE.containing_type = _TRANSLATIONTASKDETAILS
_TRANSLATIONTASKDETAILS.oneofs_by_name['language_options'].fields.append(
_TRANSLATIONTASKDETAILS.fields_by_name['teradata_options'])
_TRANSLATIONTASKDETAILS.fields_by_name['teradata_options'].containing_oneof = _TRANSLATIONTASKDETAILS.oneofs_by_name['language_options']
_TRANSLATIONTASKDETAILS.oneofs_by_name['language_options'].fields.append(
_TRANSLATIONTASKDETAILS.fields_by_name['bteq_options'])
_TRANSLATIONTASKDETAILS.fields_by_name['bteq_options'].containing_oneof = _TRANSLATIONTASKDETAILS.oneofs_by_name['language_options']
_IDENTIFIERSETTINGS.fields_by_name['output_identifier_case'].enum_type = _IDENTIFIERSETTINGS_IDENTIFIERCASE
_IDENTIFIERSETTINGS.fields_by_name['identifier_rewrite_mode'].enum_type = _IDENTIFIERSETTINGS_IDENTIFIERREWRITEMODE
_IDENTIFIERSETTINGS_IDENTIFIERCASE.containing_type = _IDENTIFIERSETTINGS
_IDENTIFIERSETTINGS_IDENTIFIERREWRITEMODE.containing_type = _IDENTIFIERSETTINGS
_BTEQOPTIONS_FILEREPLACEMENTMAPENTRY.containing_type = _BTEQOPTIONS
_BTEQOPTIONS.fields_by_name['project_dataset'].message_type = _DATASETREFERENCE
_BTEQOPTIONS.fields_by_name['file_replacement_map'].message_type = _BTEQOPTIONS_FILEREPLACEMENTMAPENTRY
DESCRIPTOR.message_types_by_name['TranslationFileMapping'] = _TRANSLATIONFILEMAPPING
DESCRIPTOR.message_types_by_name['TranslationTaskDetails'] = _TRANSLATIONTASKDETAILS
DESCRIPTOR.message_types_by_name['Filter'] = _FILTER
DESCRIPTOR.message_types_by_name['IdentifierSettings'] = _IDENTIFIERSETTINGS
DESCRIPTOR.message_types_by_name['TeradataOptions'] = _TERADATAOPTIONS
DESCRIPTOR.message_types_by_name['DatasetReference'] = _DATASETREFERENCE
DESCRIPTOR.message_types_by_name['BteqOptions'] = _BTEQOPTIONS
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
TranslationFileMapping = _reflection.GeneratedProtocolMessageType('TranslationFileMapping', (_message.Message,), {
'DESCRIPTOR' : _TRANSLATIONFILEMAPPING,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationFileMapping)
})
_sym_db.RegisterMessage(TranslationFileMapping)
TranslationTaskDetails = _reflection.GeneratedProtocolMessageType('TranslationTaskDetails', (_message.Message,), {
'SpecialTokenMapEntry' : _reflection.GeneratedProtocolMessageType('SpecialTokenMapEntry', (_message.Message,), {
'DESCRIPTOR' : _TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails.SpecialTokenMapEntry)
})
,
'DESCRIPTOR' : _TRANSLATIONTASKDETAILS,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.TranslationTaskDetails)
})
_sym_db.RegisterMessage(TranslationTaskDetails)
_sym_db.RegisterMessage(TranslationTaskDetails.SpecialTokenMapEntry)
Filter = _reflection.GeneratedProtocolMessageType('Filter', (_message.Message,), {
'DESCRIPTOR' : _FILTER,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.Filter)
})
_sym_db.RegisterMessage(Filter)
IdentifierSettings = _reflection.GeneratedProtocolMessageType('IdentifierSettings', (_message.Message,), {
'DESCRIPTOR' : _IDENTIFIERSETTINGS,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.IdentifierSettings)
})
_sym_db.RegisterMessage(IdentifierSettings)
TeradataOptions = _reflection.GeneratedProtocolMessageType('TeradataOptions', (_message.Message,), {
'DESCRIPTOR' : _TERADATAOPTIONS,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.TeradataOptions)
})
_sym_db.RegisterMessage(TeradataOptions)
DatasetReference = _reflection.GeneratedProtocolMessageType('DatasetReference', (_message.Message,), {
'DESCRIPTOR' : _DATASETREFERENCE,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.DatasetReference)
})
_sym_db.RegisterMessage(DatasetReference)
BteqOptions = _reflection.GeneratedProtocolMessageType('BteqOptions', (_message.Message,), {
'FileReplacementMapEntry' : _reflection.GeneratedProtocolMessageType('FileReplacementMapEntry', (_message.Message,), {
'DESCRIPTOR' : _BTEQOPTIONS_FILEREPLACEMENTMAPENTRY,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions.FileReplacementMapEntry)
})
,
'DESCRIPTOR' : _BTEQOPTIONS,
'__module__' : 'translation_pb2'
# @@protoc_insertion_point(class_scope:google.cloud.bigquery.migration.tasks.translation.v2alpha.BteqOptions)
})
_sym_db.RegisterMessage(BteqOptions)
_sym_db.RegisterMessage(BteqOptions.FileReplacementMapEntry)
DESCRIPTOR._options = None
_TRANSLATIONTASKDETAILS_SPECIALTOKENMAPENTRY._options = None
_BTEQOPTIONS_FILEREPLACEMENTMAPENTRY._options = None
# @@protoc_insertion_point(module_scope)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment