-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Load: Enhanced the table auto-creation logic #15265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the auto-creation logic for loading TS files by refactoring the auto-creation and verification processes and integrating database/table auto-creation into the load workflow. Key changes include:
- Refactoring of auto-deletion and auto-creation logic in ModificationUtils and LoadTsFileTableSchemaCache.
- Removal of duplicate database creation logic in LoadTsFileAnalyzer and updates to schema cache handling.
- Addition of new integration tests in IoTDBPipeWithLoadIT to validate behavior when tables are deleted or missing insert permissions.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ModificationUtils.java | Updates the device deletion check logic, transitioning from Optional to Objects-based null checks. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/LoadTsFile.java | Removes explicit initializations for several flags and thresholds, relying on Java defaults. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileTableSchemaCache.java | Introduces new fields and methods to support auto-creation of databases and manages table schema mappings. |
| iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/load/LoadTsFileAnalyzer.java | Refactors schema cache utilization and removes redundant database creation logic. |
| integration-test/src/test/java/org/apache/iotdb/pipe/it/dual/tablemodel/manual/basic/IoTDBPipeWithLoadIT.java | Adds integration tests for scenarios involving auto-creation with table deletion and permission issues. |
Comments suppressed due to low confidence (1)
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/sql/ast/LoadTsFile.java:44
- Removal of explicit default values for fields (e.g., deleteAfterLoad, convertOnTypeMismatch, tabletConversionThresholdBytes, autoCreateDatabase, verify) may unintentionally change their default behavior. Confirm that relying on Java’s default values is intentional compared to the previous explicit initialization.
private boolean deleteAfterLoad;
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ModificationUtils.java
Outdated
Show resolved
Hide resolved
…dificationUtils.java Co-authored-by: Copilot <[email protected]>
b8b393d to
2b03d4c
Compare
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/ModificationUtils.java
Show resolved
Hide resolved
This reverts commit 8eb73e0.
This reverts commit 6b20d82.
(cherry picked from commit 8eb73e0)
Description
As the title said.
This PR has:
for an unfamiliar reader.
for code coverage.
Key changed/added classes (or packages if there are too many classes) in this PR