diff --git a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/templates/DataStreamToSQL.java b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/templates/DataStreamToSQL.java index 9199a31ff9..2e7c029871 100644 --- a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/templates/DataStreamToSQL.java +++ b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/templates/DataStreamToSQL.java @@ -356,6 +356,7 @@ public static PipelineResult run(Options options) { CdcJdbcIO.DataSourceConfiguration dataSourceConfiguration = getDataSourceConfiguration(options); validateOptions(options, dataSourceConfiguration); Map schemaMap = parseSchemaMap(options.getSchemaMap()); + LOG.info("Parsed schema map: {}", schemaMap); /* * Stage 1: Ingest and Normalize Data to FailsafeElement with JSON Strings diff --git a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/transforms/CreateDml.java b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/transforms/CreateDml.java index 8a5a8965a3..7c01d528be 100644 --- a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/transforms/CreateDml.java +++ b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/transforms/CreateDml.java @@ -63,10 +63,12 @@ public DatastreamToDML getDatastreamToDML() { String driverName = this.dataSourceConfiguration.getDriverClassName().get(); switch (driverName) { case "org.postgresql.Driver": - datastreamToDML = DatastreamToPostgresDML.of(dataSourceConfiguration); + datastreamToDML = + DatastreamToPostgresDML.of(dataSourceConfiguration).withSchemaMap(this.schemaMap); break; case "com.mysql.cj.jdbc.Driver": - datastreamToDML = DatastreamToMySQLDML.of(dataSourceConfiguration); + datastreamToDML = + DatastreamToMySQLDML.of(dataSourceConfiguration).withSchemaMap(this.schemaMap); break; default: throw new IllegalArgumentException( diff --git a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/utils/DatastreamToDML.java b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/utils/DatastreamToDML.java index dd39be5779..6a208e3579 100644 --- a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/utils/DatastreamToDML.java +++ b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/utils/DatastreamToDML.java @@ -55,7 +55,7 @@ public abstract class DatastreamToDML private CdcJdbcIO.DataSourceConfiguration dataSourceConfiguration; private DataSource dataSource; public String quoteCharacter; - private static Map schemaMap = new HashMap(); + protected Map schemaMap = new HashMap(); public abstract String getDefaultQuoteCharacter();