Skip to content

Conversation

@CRZbulabula
Copy link
Contributor

To prepare for supporting multi/co-variable models in AINode, we refactor the table forecast function in this PR, main ideas and updates include:

  1. When invoking table value forecast function, all specified input columns should be delivered to AINode as the model's input channels.
  2. When invoking table value forecast function, the users are suggested to specify the PREDICATED_COLUMNS. In this way, the IoTDB can realize the count and data types of the forecast result.

Copy link
Contributor

Copilot AI left a 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 types field into inputColumnTypes and predicatedColumnTypes for 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.

Comment on lines +511 to +517
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) {
Copy link

Copilot AI Nov 1, 2025

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.

Suggested change
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++) {

Copilot uses AI. Check for mistakes.
}
this.inputTsBlockBuilder = new TsBlockBuilder(inputTsDataTypeList);
this.inputColumnAppenderList = new ArrayList<>(functionHandle.inputColumnTypes.size());
for (Type type : functionHandle.inputColumnTypes) {
Copy link

Copilot AI Nov 1, 2025

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.

Suggested change
for (Type type : functionHandle.inputColumnTypes) {
for (int i = 0; i < functionHandle.inputColumnTypes.size(); i++) {

Copilot uses AI. Check for mistakes.
…ine/plan/relational/function/tvf/ForecastTableFunction.java

Co-authored-by: Copilot <[email protected]>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 1, 2025

@codecov
Copy link

codecov bot commented Nov 1, 2025

Codecov Report

❌ Patch coverage is 28.57143% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 38.72%. Comparing base (685141a) to head (13b90b1).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
...relational/function/tvf/ForecastTableFunction.java 30.00% 28 Missing ⚠️
...he/iotdb/db/queryengine/plan/udf/UDTFForecast.java 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RkGrit
Copy link
Contributor

RkGrit commented Nov 2, 2025

LGTM!
But why not also support multi/co-variable models for the tree value forecast function?

@CRZbulabula CRZbulabula closed this Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants