diff --git a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/io/CdcJdbcIO.java b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/io/CdcJdbcIO.java index 78058aa150..5e832a4e63 100644 --- a/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/io/CdcJdbcIO.java +++ b/v2/datastream-to-sql/src/main/java/com/google/cloud/teleport/v2/io/CdcJdbcIO.java @@ -589,7 +589,10 @@ private void executeBatchSingleStatementFormatting() statement.executeUpdate(formattedStatement); connection.commit(); } catch (SQLException exception) { - LOG.error("SQLException Occurred: {}", exception.toString()); + LOG.error( + "SQLException Occurred: {} while executing statement: {}", + exception.toString(), + formattedStatement); connection.rollback(); } } 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 ab14282c32..b6b56c1750 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 @@ -106,7 +106,10 @@ public void processElement(ProcessContext context) { // Null rows suggest no DML is required. if (dmlInfo != null) { + LOG.debug("Output Data: {}", jsonString); context.output(KV.of(dmlInfo.getStateWindowKey(), dmlInfo)); + } else { + LOG.debug("Skipping Null DmlInfo: {}", jsonString); } } catch (IOException e) { // TODO(dhercher): Push failure to DLQ collection @@ -209,6 +212,7 @@ public DmlInfo convertJsonToDmlInfo(JsonNode rowObj, String failsafeValue) { Map tableSchema = this.getTableSchema(catalogName, schemaName, tableName); if (tableSchema.isEmpty()) { // If the table DNE we return null (NOOP) + LOG.debug("Table Not Found: {}.{}.{}", catalogName, schemaName, tableName); return null; }