You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "azexcy (via GitHub)" <gi...@apache.org> on 2023/04/21 06:09:01 UTC

[GitHub] [shardingsphere] azexcy opened a new pull request, #25257: Fix delete event before values is null at pipeline DataRecord

azexcy opened a new pull request, #25257:
URL: https://github.com/apache/shardingsphere/pull/25257

   
   Changes proposed in this pull request:
     - Fix delete event before values is null at pipeline DataRecord
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [ ] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [ ] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz commented on a diff in pull request #25257: Fix delete event before values is null at pipeline DataRecord

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on code in PR #25257:
URL: https://github.com/apache/shardingsphere/pull/25257#discussion_r1173397337


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/importer/DataRecordMerger.java:
##########
@@ -119,21 +119,22 @@ private void mergeUpdate(final DataRecord dataRecord, final Map<DataRecord.Key,
     }
     
     private void mergeDelete(final DataRecord dataRecord, final Map<DataRecord.Key, DataRecord> dataRecords) {
-        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getKey());
+        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getOldKey());

Review Comment:
   1, `dataRecord.getOldKey()` might be `null`?
   
   2, Could `dataRecord.getOldKey()` method name be updated?
   



##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/importer/DataSourceImporter.java:
##########
@@ -221,7 +221,7 @@ private void executeUpdate(final Connection connection, final DataRecord record)
             }
             for (int i = 0; i < conditionColumns.size(); i++) {
                 Column keyColumn = conditionColumns.get(i);
-                preparedStatement.setObject(updatedColumns.size() + i + 1, keyColumn.isUniqueKey() && keyColumn.isUpdated() ? keyColumn.getOldValue() : keyColumn.getValue());
+                preparedStatement.setObject(updatedColumns.size() + i + 1, keyColumn.getOldValue());

Review Comment:
   `keyColumn.getOldValue()` might be `null`?



##########
kernel/data-pipeline/api/src/main/java/org/apache/shardingsphere/data/pipeline/api/ingest/record/Column.java:
##########
@@ -40,10 +40,6 @@ public final class Column {
     
     private final boolean uniqueKey;
     
-    public Column(final String name, final Object value, final boolean updated, final boolean uniqueKey) {
-        this(name, null, value, updated, uniqueKey);
-    }

Review Comment:
   Could we keep this constructor? To reduce unrelated changes



##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/importer/DataRecordMerger.java:
##########
@@ -119,21 +119,22 @@ private void mergeUpdate(final DataRecord dataRecord, final Map<DataRecord.Key,
     }
     
     private void mergeDelete(final DataRecord dataRecord, final Map<DataRecord.Key, DataRecord> dataRecords) {
-        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getKey());

Review Comment:
   Could we remove `mergeDelete` and `merge` methods etc



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz merged pull request #25257: Fix delete event before values is null at pipeline DataRecord

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz merged PR #25257:
URL: https://github.com/apache/shardingsphere/pull/25257


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] azexcy commented on a diff in pull request #25257: Fix delete event before values is null at pipeline DataRecord

Posted by "azexcy (via GitHub)" <gi...@apache.org>.
azexcy commented on code in PR #25257:
URL: https://github.com/apache/shardingsphere/pull/25257#discussion_r1173641078


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/importer/DataRecordMerger.java:
##########
@@ -119,21 +119,22 @@ private void mergeUpdate(final DataRecord dataRecord, final Map<DataRecord.Key,
     }
     
     private void mergeDelete(final DataRecord dataRecord, final Map<DataRecord.Key, DataRecord> dataRecords) {
-        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getKey());

Review Comment:
   I'll think about it later



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] azexcy commented on a diff in pull request #25257: Fix delete event before values is null at pipeline DataRecord

Posted by "azexcy (via GitHub)" <gi...@apache.org>.
azexcy commented on code in PR #25257:
URL: https://github.com/apache/shardingsphere/pull/25257#discussion_r1173643750


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/importer/DataRecordMerger.java:
##########
@@ -119,21 +119,22 @@ private void mergeUpdate(final DataRecord dataRecord, final Map<DataRecord.Key,
     }
     
     private void mergeDelete(final DataRecord dataRecord, final Map<DataRecord.Key, DataRecord> dataRecords) {
-        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getKey());
+        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getOldKey());

Review Comment:
   Delete record before have value, after is nul, the getOldKey() will get the before uniquke value, is't not null 



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sandynz commented on a diff in pull request #25257: Fix delete event before values is null at pipeline DataRecord

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on code in PR #25257:
URL: https://github.com/apache/shardingsphere/pull/25257#discussion_r1173674738


##########
kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/importer/DataRecordMerger.java:
##########
@@ -119,21 +119,22 @@ private void mergeUpdate(final DataRecord dataRecord, final Map<DataRecord.Key,
     }
     
     private void mergeDelete(final DataRecord dataRecord, final Map<DataRecord.Key, DataRecord> dataRecords) {
-        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getKey());
+        DataRecord beforeDataRecord = dataRecords.get(dataRecord.getOldKey());

Review Comment:
   OK



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org