-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[AINode] Refactor table forecast function #16686
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 pull request refactors the ForecastTableFunction to separate input column types from predicted column types, addressing the distinction between columns used as inputs for model forecasting and columns that are predicted as outputs.
- Split the single
typesfield intoinputColumnTypesandpredicatedColumnTypesfor clearer separation of concerns - Fixed logic to properly track which columns are inputs to the model versus which columns will have predicted outputs
- Updated serialization/deserialization to handle both type lists separately
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| TableFunctionTest.java | Updated test assertions to include the new inputColumnTypes parameter in ForecastTableFunctionHandle construction |
| UDTFForecast.java | Removed Chinese comments and simplified code formatting |
| ForecastTableFunction.java | Core refactoring to split types into inputColumnTypes and predicatedColumnTypes, updated serialization/deserialization, and refined column tracking logic |
| .gitignore | Removed /iotdb/__init__.py from ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...java/org/apache/iotdb/db/queryengine/plan/relational/function/tvf/ForecastTableFunction.java
Outdated
Show resolved
Hide resolved
| for (Type type : functionHandle.inputColumnTypes) { | ||
| // AINode currently only accept double input | ||
| inputTsDataTypeList.add(TSDataType.DOUBLE); | ||
| } | ||
| this.inputTsBlockBuilder = new TsBlockBuilder(inputTsDataTypeList); | ||
| this.inputColumnAppenderList = new ArrayList<>(functionHandle.inputColumnTypes.size()); | ||
| for (Type type : functionHandle.inputColumnTypes) { |
Copilot
AI
Nov 1, 2025
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.
Variable 'Type type' is never read.
| for (Type type : functionHandle.inputColumnTypes) { | |
| // AINode currently only accept double input | |
| inputTsDataTypeList.add(TSDataType.DOUBLE); | |
| } | |
| this.inputTsBlockBuilder = new TsBlockBuilder(inputTsDataTypeList); | |
| this.inputColumnAppenderList = new ArrayList<>(functionHandle.inputColumnTypes.size()); | |
| for (Type type : functionHandle.inputColumnTypes) { | |
| for (int i = 0; i < functionHandle.inputColumnTypes.size(); i++) { | |
| // AINode currently only accept double input | |
| inputTsDataTypeList.add(TSDataType.DOUBLE); | |
| } | |
| this.inputTsBlockBuilder = new TsBlockBuilder(inputTsDataTypeList); | |
| this.inputColumnAppenderList = new ArrayList<>(functionHandle.inputColumnTypes.size()); | |
| for (int i = 0; i < functionHandle.inputColumnTypes.size(); i++) { |
| } | ||
| this.inputTsBlockBuilder = new TsBlockBuilder(inputTsDataTypeList); | ||
| this.inputColumnAppenderList = new ArrayList<>(functionHandle.inputColumnTypes.size()); | ||
| for (Type type : functionHandle.inputColumnTypes) { |
Copilot
AI
Nov 1, 2025
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.
Variable 'Type type' is never read.
| for (Type type : functionHandle.inputColumnTypes) { | |
| for (int i = 0; i < functionHandle.inputColumnTypes.size(); i++) { |
…ine/plan/relational/function/tvf/ForecastTableFunction.java Co-authored-by: Copilot <[email protected]>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #16686 +/- ##
============================================
- Coverage 38.72% 38.72% -0.01%
Complexity 207 207
============================================
Files 4986 4986
Lines 330362 330376 +14
Branches 42000 42007 +7
============================================
- Hits 127938 127935 -3
- Misses 202424 202441 +17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
LGTM! |



To prepare for supporting multi/co-variable models in AINode, we refactor the table forecast function in this PR, main ideas and updates include:
PREDICATED_COLUMNS. In this way, the IoTDB can realize the count and data types of the forecast result.