sandynz commented on code in PR #21071:
URL: https://github.com/apache/shardingsphere/pull/21071#discussion_r974926593


##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/general/MySQLMigrationGeneralIT.java:
##########
@@ -86,13 +86,13 @@ public void assertMigrationSuccess() throws SQLException, 
InterruptedException {
         JdbcTemplate jdbcTemplate = new JdbcTemplate(getSourceDataSource());
         Pair<List<Object[]>, List<Object[]>> dataPair = 
ScalingCaseHelper.generateFullInsertData(keyGenerateAlgorithm, 
parameterized.getDatabaseType(), 3000);
         log.info("init data begin: {}", LocalDateTime.now());
-        jdbcTemplate.batchUpdate(getExtraSQLCommand().getFullInsertOrder(), 
dataPair.getLeft());
+        
jdbcTemplate.batchUpdate(String.format(getExtraSQLCommand().getFullInsertOrder(),
 SOURCE_TABLE_ORDER), dataPair.getLeft());

Review Comment:
   Could we add parameter for `getExtraSQLCommand().getFullInsertOrder()`, then 
IT case could just get whole SQL



##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java:
##########
@@ -189,22 +189,6 @@ protected String getActualJdbcUrlTemplate(final String 
databaseName, final boole
         return DataSourceEnvironment.getURL(getDatabaseType(), "127.0.0.1", 
ENV.getActualDataSourceDefaultPort(databaseType), databaseName);
     }
     
-    protected void createSourceOrderTable() throws SQLException {
-        sourceExecuteWithLog(extraSQLCommand.getCreateTableOrder());
-    }
-    
-    protected void createSourceTableIndexList(final String schema) throws 
SQLException {
-        if (DatabaseTypeUtil.isPostgreSQL(getDatabaseType())) {
-            sourceExecuteWithLog(String.format("CREATE INDEX IF NOT EXISTS 
idx_user_id ON %s.t_order_copy ( user_id )", schema));
-        } else if (DatabaseTypeUtil.isOpenGauss(getDatabaseType())) {
-            sourceExecuteWithLog(String.format("CREATE INDEX idx_user_id ON 
%s.t_order_copy ( user_id )", schema));
-        }
-    }
-    
-    protected void createSourceCommentOnList(final String schema) throws 
SQLException {
-        sourceExecuteWithLog(String.format("COMMENT ON COLUMN 
%s.t_order_copy.user_id IS 'user id'", schema));
-    }
-    

Review Comment:
   Could we still keep these methods in BaseITCase for common usage?



##########
shardingsphere-test/shardingsphere-integration-test/shardingsphere-integration-test-scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/migration/AbstractMigrationITCase.java:
##########
@@ -42,6 +43,11 @@
 @Slf4j
 public abstract class AbstractMigrationITCase extends BaseITCase {
     
+    protected static final String SOURCE_TABLE_ORDER = "t_order_copy";
+    
+    protected static final String SOURCE_TABLE_ORDER_ITEM = "t_order_item";

Review Comment:
   It's better to use protected method, then it could be overrided in sub-class



-- 
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]

Reply via email to