Skip to content
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

[AINode] Support output time column for model inference #15069

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ycycse
Copy link
Member

@ycycse ycycse commented Mar 12, 2025

This PR supports to generate time column by setting attribute in CALL INFERENCE in tree model. The timestamp column is generated based on the average interval of the input data.

call inference(<model_name>,sql[,generateTime=True/False][,window=<window_function>])

IoTDB> call inference(timer_test,'select s1,s2,s3 from root.** limit 7')
+-------+-------+-------+
|output0|output1|output2|
+-------+-------+-------+
|  3.885|  8.706|  2.025|
|  3.952|  8.813|   2.31|
|   2.88|  7.533|  1.564|
|   2.21|  7.249|  1.066|
|  2.143|    7.0|  0.888|
|  3.148|  7.995|   1.35|
|  3.014|   9.31|  1.457|
+-------+-------+-------+
Total line number = 7
It costs 0.029s
IoTDB> call inference(timer_test,'select s1,s2,s3 from root.** limit 7',generateTime=true)
+-----------------------------+-------+-------+-------+
|                         Time|output0|output1|output2|
+-----------------------------+-------+-------+-------+
|2017-10-20T06:00:00.000+08:00|  3.885|  8.706|  2.025|
|2017-10-20T06:51:25.714+08:00|  3.952|  8.813|   2.31|
|2017-10-20T07:42:51.428+08:00|   2.88|  7.533|  1.564|
|2017-10-20T08:34:17.142+08:00|   2.21|  7.249|  1.066|
|2017-10-20T09:25:42.856+08:00|  2.143|    7.0|  0.888|
|2017-10-20T10:17:08.570+08:00|  3.148|  7.995|   1.35|
|2017-10-20T11:08:34.284+08:00|  3.014|   9.31|  1.457|
+-----------------------------+-------+-------+-------+
Total line number = 7
It costs 0.031s

Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 2.22222% with 44 lines in your changes missing coverage. Please review.

Project coverage is 39.44%. Comparing base (a7ebfa8) to head (d2ef477).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...ecution/operator/process/ai/InferenceOperator.java 0.00% 23 Missing ⚠️
...an/planner/plan/node/process/AI/InferenceNode.java 0.00% 10 Missing ⚠️
...e/iotdb/db/queryengine/plan/parser/ASTVisitor.java 0.00% 3 Missing ⚠️
...ueryengine/plan/statement/crud/QueryStatement.java 25.00% 3 Missing ⚠️
...db/db/queryengine/plan/analyze/AnalyzeVisitor.java 0.00% 2 Missing ⚠️
...b/queryengine/plan/planner/LogicalPlanBuilder.java 0.00% 1 Missing ⚠️
...b/queryengine/plan/planner/LogicalPlanVisitor.java 0.00% 1 Missing ⚠️
...ueryengine/plan/planner/OperatorTreeGenerator.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #15069      +/-   ##
============================================
+ Coverage     39.43%   39.44%   +0.01%     
  Complexity      193      193              
============================================
  Files          4596     4596              
  Lines        295115   295155      +40     
  Branches      36688    36696       +8     
============================================
+ Hits         116385   116431      +46     
+ Misses       178730   178724       -6     

☔ 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.

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.

1 participant