translation_config.proto 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.cloud.bigquery.migration.v2;
  16. option csharp_namespace = "Google.Cloud.BigQuery.Migration.V2";
  17. option go_package = "google.golang.org/genproto/googleapis/cloud/bigquery/migration/v2;migration";
  18. option java_multiple_files = true;
  19. option java_outer_classname = "TranslationConfigProto";
  20. option java_package = "com.google.cloud.bigquery.migration.v2";
  21. option php_namespace = "Google\\Cloud\\BigQuery\\Migration\\V2";
  22. // The translation config to capture necessary settings for a translation task
  23. // and subtask.
  24. message TranslationConfigDetails {
  25. // The chosen path where the source for input files will be found.
  26. oneof source_location {
  27. // The Cloud Storage path for a directory of files to translate in a task.
  28. string gcs_source_path = 1;
  29. }
  30. // The chosen path where the destination for output files will be found.
  31. oneof target_location {
  32. // The Cloud Storage path to write back the corresponding input files to.
  33. string gcs_target_path = 2;
  34. }
  35. // The dialect of the input files.
  36. Dialect source_dialect = 3;
  37. // The target dialect for the engine to translate the input to.
  38. Dialect target_dialect = 4;
  39. // The mapping of full SQL object names from their current state to the
  40. // desired output.
  41. oneof output_name_mapping {
  42. // The mapping of objects to their desired output names in list form.
  43. ObjectNameMappingList name_mapping_list = 5;
  44. }
  45. // The default source environment values for the translation.
  46. SourceEnv source_env = 6;
  47. }
  48. // The possible dialect options for translation.
  49. message Dialect {
  50. // The possible dialect options that this message represents.
  51. oneof dialect_value {
  52. // The BigQuery dialect
  53. BigQueryDialect bigquery_dialect = 1;
  54. // The HiveQL dialect
  55. HiveQLDialect hiveql_dialect = 2;
  56. // The Redshift dialect
  57. RedshiftDialect redshift_dialect = 3;
  58. // The Teradata dialect
  59. TeradataDialect teradata_dialect = 4;
  60. // The Oracle dialect
  61. OracleDialect oracle_dialect = 5;
  62. // The SparkSQL dialect
  63. SparkSQLDialect sparksql_dialect = 6;
  64. // The Snowflake dialect
  65. SnowflakeDialect snowflake_dialect = 7;
  66. // The Netezza dialect
  67. NetezzaDialect netezza_dialect = 8;
  68. // The Azure Synapse dialect
  69. AzureSynapseDialect azure_synapse_dialect = 9;
  70. // The Vertica dialect
  71. VerticaDialect vertica_dialect = 10;
  72. // The SQL Server dialect
  73. SQLServerDialect sql_server_dialect = 11;
  74. // The Postgresql dialect
  75. PostgresqlDialect postgresql_dialect = 12;
  76. // The Presto dialect
  77. PrestoDialect presto_dialect = 13;
  78. // The MySQL dialect
  79. MySQLDialect mysql_dialect = 14;
  80. }
  81. }
  82. // The dialect definition for BigQuery.
  83. message BigQueryDialect {}
  84. // The dialect definition for HiveQL.
  85. message HiveQLDialect {}
  86. // The dialect definition for Redshift.
  87. message RedshiftDialect {}
  88. // The dialect definition for Teradata.
  89. message TeradataDialect {
  90. // The sub-dialect options for Teradata.
  91. enum Mode {
  92. // Unspecified mode.
  93. MODE_UNSPECIFIED = 0;
  94. // Teradata SQL mode.
  95. SQL = 1;
  96. // BTEQ mode (which includes SQL).
  97. BTEQ = 2;
  98. }
  99. // Which Teradata sub-dialect mode the user specifies.
  100. Mode mode = 1;
  101. }
  102. // The dialect definition for Oracle.
  103. message OracleDialect {}
  104. // The dialect definition for SparkSQL.
  105. message SparkSQLDialect {}
  106. // The dialect definition for Snowflake.
  107. message SnowflakeDialect {}
  108. // The dialect definition for Netezza.
  109. message NetezzaDialect {}
  110. // The dialect definition for Azure Synapse.
  111. message AzureSynapseDialect {}
  112. // The dialect definition for Vertica.
  113. message VerticaDialect {}
  114. // The dialect definition for SQL Server.
  115. message SQLServerDialect {}
  116. // The dialect definition for Postgresql.
  117. message PostgresqlDialect {}
  118. // The dialect definition for Presto.
  119. message PrestoDialect {}
  120. // The dialect definition for MySQL.
  121. message MySQLDialect {}
  122. // Represents a map of name mappings using a list of key:value proto messages of
  123. // existing name to desired output name.
  124. message ObjectNameMappingList {
  125. // The elements of the object name map.
  126. repeated ObjectNameMapping name_map = 1;
  127. }
  128. // Represents a key-value pair of NameMappingKey to NameMappingValue to
  129. // represent the mapping of SQL names from the input value to desired output.
  130. message ObjectNameMapping {
  131. // The name of the object in source that is being mapped.
  132. NameMappingKey source = 1;
  133. // The desired target name of the object that is being mapped.
  134. NameMappingValue target = 2;
  135. }
  136. // The potential components of a full name mapping that will be mapped
  137. // during translation in the source data warehouse.
  138. message NameMappingKey {
  139. // The type of the object that is being mapped.
  140. enum Type {
  141. // Unspecified name mapping type.
  142. TYPE_UNSPECIFIED = 0;
  143. // The object being mapped is a database.
  144. DATABASE = 1;
  145. // The object being mapped is a schema.
  146. SCHEMA = 2;
  147. // The object being mapped is a relation.
  148. RELATION = 3;
  149. // The object being mapped is an attribute.
  150. ATTRIBUTE = 4;
  151. // The object being mapped is a relation alias.
  152. RELATION_ALIAS = 5;
  153. // The object being mapped is a an attribute alias.
  154. ATTRIBUTE_ALIAS = 6;
  155. // The object being mapped is a function.
  156. FUNCTION = 7;
  157. }
  158. // The type of object that is being mapped.
  159. Type type = 1;
  160. // The database name (BigQuery project ID equivalent in the source data
  161. // warehouse).
  162. string database = 2;
  163. // The schema name (BigQuery dataset equivalent in the source data warehouse).
  164. string schema = 3;
  165. // The relation name (BigQuery table or view equivalent in the source data
  166. // warehouse).
  167. string relation = 4;
  168. // The attribute name (BigQuery column equivalent in the source data
  169. // warehouse).
  170. string attribute = 5;
  171. }
  172. // The potential components of a full name mapping that will be mapped
  173. // during translation in the target data warehouse.
  174. message NameMappingValue {
  175. // The database name (BigQuery project ID equivalent in the target data
  176. // warehouse).
  177. string database = 1;
  178. // The schema name (BigQuery dataset equivalent in the target data warehouse).
  179. string schema = 2;
  180. // The relation name (BigQuery table or view equivalent in the target data
  181. // warehouse).
  182. string relation = 3;
  183. // The attribute name (BigQuery column equivalent in the target data
  184. // warehouse).
  185. string attribute = 4;
  186. }
  187. // Represents the default source environment values for the translation.
  188. message SourceEnv {
  189. // The default database name to fully qualify SQL objects when their database
  190. // name is missing.
  191. string default_database = 1;
  192. // The schema search path. When SQL objects are missing schema name,
  193. // translation engine will search through this list to find the value.
  194. repeated string schema_search_path = 2;
  195. }