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


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/yaml/consistency/YamlDataConsistencyCheckResult.java:
##########
@@ -32,6 +32,10 @@ public final class YamlDataConsistencyCheckResult implements 
YamlConfiguration {
     
     private YamlDataConsistencyContentCheckResult contentCheckResult;
     
+    private String checkIgnoredType;

Review Comment:
   Could `checkIgnoredType` be `ignoredType`? Then it's consistent with 
`ignored` field



##########
kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/check/consistency/DataConsistencyCheckResult.java:
##########
@@ -27,35 +27,40 @@
 @ToString
 public final class DataConsistencyCheckResult {
     
+    private final DataConsistencyCheckIgnoredType checkIgnoredType;
+    
     private final DataConsistencyCountCheckResult countCheckResult;
     
     private final DataConsistencyContentCheckResult contentCheckResult;
     
-    private final DataConsistencyCheckIgnoredType checkIgnoredType;
-    
-    private final boolean ignored;
-    
     public DataConsistencyCheckResult(final DataConsistencyCountCheckResult 
countCheckResult, final DataConsistencyContentCheckResult contentCheckResult) {
+        checkIgnoredType = null;
         this.countCheckResult = countCheckResult;
         this.contentCheckResult = contentCheckResult;
-        checkIgnoredType = null;
-        ignored = false;
     }
     
     public DataConsistencyCheckResult(final DataConsistencyCheckIgnoredType 
checkIgnoredType) {
         this.checkIgnoredType = checkIgnoredType;
-        ignored = true;
         countCheckResult = null;
         contentCheckResult = null;
     }
     
+    /**
+     * Is ignored.
+     *
+     * @return ignored or not
+     */
+    public boolean isIgnored() {
+        return checkIgnoredType != null;
+    }

Review Comment:
   1, Method could be `final`.
   
   2, `checkIgnoredType != null` could be `null != checkIgnoredType`.
   



##########
test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/primarykey/NonePrimaryKeyMigrationE2EIT.java:
##########
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.primarykey;
+
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shardingsphere.infra.database.type.dialect.MySQLDatabaseType;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.base.PipelineBaseE2EIT;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.cases.migration.AbstractMigrationE2EIT;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.env.enums.PipelineEnvTypeEnum;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.helper.PipelineCaseHelper;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.framework.param.PipelineTestParameter;
+import 
org.apache.shardingsphere.test.e2e.data.pipeline.util.AutoIncrementKeyGenerateAlgorithm;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.is;
+import static org.junit.Assert.assertFalse;
+
+@RunWith(Parameterized.class)
+@Slf4j
+public final class NonePrimaryKeyMigrationE2EIT extends AbstractMigrationE2EIT 
{

Review Comment:
   `NonePrimaryKeyMigrationE2EIT` class name could be improved, keep consistent 
with enum name



##########
kernel/data-pipeline/scenario/migration/src/main/java/org/apache/shardingsphere/data/pipeline/scenario/migration/check/consistency/MigrationDataConsistencyChecker.java:
##########
@@ -77,12 +78,17 @@ public Map<String, DataConsistencyCheckResult> check(final 
DataConsistencyCalcul
         verifyPipelineDatabaseType(calculateAlgorithm, jobConfig.getTarget());
         SchemaTableName sourceTable = new SchemaTableName(new 
SchemaName(tableNameSchemaNameMapping.getSchemaName(jobConfig.getSourceTableName())),
 new TableName(jobConfig.getSourceTableName()));
         SchemaTableName targetTable = new SchemaTableName(new 
SchemaName(tableNameSchemaNameMapping.getSchemaName(jobConfig.getTargetTableName())),
 new TableName(jobConfig.getTargetTableName()));
+        progressContext.getTableNames().add(jobConfig.getSourceTableName());

Review Comment:
   OK



##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/prepare/InventoryTaskSplitter.java:
##########
@@ -155,6 +164,31 @@ private Collection<IngestPosition<?>> 
getInventoryPositions(final InventoryIncre
         throw new 
SplitPipelineJobByRangeException(dumperConfig.getActualTableName(), "primary 
key is not integer or string type");
     }
     
+    private Collection<IngestPosition<?>> getPositionByNonePrimaryKey(final 
InventoryIncrementalJobItemContext jobItemContext, final DataSource dataSource,

Review Comment:
   `getPositionByNonePrimaryKey` could be `getPositionWithoutUniqueKey`



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