Feat (AINode): Add timexl and sundial in create model (test) #15651
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
This PR implements support for CREATE MODEL statements in Apache IoTDB, enabling users to register and manage AI/ML models within the IoTDB ecosystem. The implementation includes model registration, lifecycle management, and integration with the AI Node component.
The PR is used for showing the changes in our code, SO PLEASE DO NOT PASS THE PR !
If you find that there are comments or output in Chinese in the code, this is just for easy testing on different machines. The release version will not include these notes.
Model Registration and Management
The implementation introduces a comprehensive model management system that allows users to register models using URI-based references. The system supports various model types including user-defined models, with built-in support for TimerXL and Sundial forecasting models. The design emphasizes flexibility by allowing external model repositories and local file system references.
Key design decisions:
SQL Grammar and Parsing
The SQL grammar has been extended to support CREATE MODEL, DROP MODEL, and SHOW MODELS statements. The parser integrates seamlessly with IoTDB's existing SQL infrastructure while maintaining backward compatibility.
Design considerations:
Alternative considered: We evaluated using a JSON-based configuration approach but chose the URI pattern for consistency with IoTDB's existing LOAD/REMOVE commands.
AI Node Integration
The implementation leverages IoTDB's AI Node component for actual model execution and inference. The DataNode acts as a coordinator, delegating model operations to appropriate AI Nodes while maintaining metadata consistency.
Architecture decisions:
Error Handling and Resource Management
The system implements comprehensive error handling for various failure scenarios including network issues, insufficient resources, and invalid model configurations.
Error handling strategies:
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
org.apache.iotdb.ainode.model.ModelLoader
org.apache.iotdb.it.ainode.CreateModelIT