[Load] Handle empty path nodes during database auto-creation - #18307
Merged
jt2594838 merged 3 commits intoJul 27, 2026
Conversation
jt2594838
approved these changes
Jul 27, 2026
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.
Description
A tree-model TsFile may contain a segmented device ID with an empty path node, for example
root.represented as["root", ""]. LOAD previously copied those segments into aPartialPathwithout structural validation and could derive an invalidroot.database path.Clusters affected by the old behavior may already contain such a legacy
root.database. When LOAD listed existing databases, the previous string-prefix check treated valid candidates such asroot.sgas covered byroot., skipped their creation, and could make ordinary TsFiles fail to load.This PR:
root.already exists;root.sgandroot.sg1are not incorrectly treated as ancestors of one another.The ConfigNode-wide guard that prevents new database paths with empty nodes is handled separately in #18308.
Tests
mvn spotless:apply -pl iotdb-core/datanodeLoadTsFileAnalyzerTestcompiled against the current module dependencies and run with JUnitCore (7 tests passed).This PR has:
Key changed/added class
TreeSchemaAutoCreatorAndVerifier