Fix duplicate table device attribute updates in multi-row insert#18176
Open
Caideyipi wants to merge 1 commit into
Open
Fix duplicate table device attribute updates in multi-row insert#18176Caideyipi wants to merge 1 commit into
Caideyipi wants to merge 1 commit into
Conversation
cd3eef5 to
0fa5dd0
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
INSERTbefore schema validation.(database, table, deviceId), keep the last effective non-null attribute value per attribute; missing attributes and insertednullremain no-ops.Root cause
A no-tag table is still an exact device match: its device id is the table plus an empty tag tuple. The real issue was that
InsertRowsvalidated repeated rows for the same device one by one, so multiple attribute updates in a single statement could be affected by validation/cache ordering instead of the final row state.Tests
mvn spotless:apply -pl iotdb-core/datanode,integration-test -P with-integration-testsmvn --% -o -Ddevelocity.off=true -pl iotdb-core/datanode -Dtest=TableDeviceSchemaValidatorTest testmvn --% -o -Ddevelocity.off=true install -DskipTests -pl iotdb-core/datanode -ammvn --% -o -Ddevelocity.off=true verify -DskipUTs -Dit.test=IoTDBDeletionTableIT#testDeleteDataByAttributeFilterWithoutTagColumns -DfailIfNoTests=false -Dfailsafe.failIfNoSpecifiedTests=false -pl integration-test -PTableClusterIT -P with-integration-tests