Hisoka-X commented on code in PR #8029:
URL: https://github.com/apache/seatunnel/pull/8029#discussion_r1849666303
##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mongodb-e2e/src/test/java/mongodb/MongodbCDCIT.java:
##########
@@ -295,12 +312,35 @@ private List<List<Object>> querySql() {
}
}
+ private void truncateMysqlTable(String tableName) {
+ String checkTableExistsSql =
+ "SELECT COUNT(*) FROM information_schema.tables WHERE
table_schema = ? AND table_name = ?";
+ String truncateTableSql = String.format("TRUNCATE TABLE %s",
tableName);
+
+ try (Connection connection = getJdbcConnection();
+ PreparedStatement checkStmt =
connection.prepareStatement(checkTableExistsSql)) {
+ checkStmt.setString(1, MYSQL_DATABASE); // 或者你可以直接提供数据库名
Review Comment:
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]