You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by yc...@apache.org on 2024/11/04 07:15:04 UTC
(iotdb) branch ainodeFix created (now 5fe0c184ac1)
This is an automated email from the ASF dual-hosted git repository.
ycycse pushed a change to branch ainodeFix
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 5fe0c184ac1 fix built-in model inference error
This branch includes the following new commits:
new 5fe0c184ac1 fix built-in model inference error
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iotdb) 01/01: fix built-in model inference error
Posted by yc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
ycycse pushed a commit to branch ainodeFix
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 5fe0c184ac1389d6fd7c9550631be6073a54817e
Author: ycycse <yc...@gmail.com>
AuthorDate: Mon Nov 4 15:14:41 2024 +0800
fix built-in model inference error
---
.../test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java | 13 +++++++++++++
.../ainode/iotdb/ainode/model/built_in_model_factory.py | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
index 17404a50e9d..0306b1a5225 100644
--- a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
@@ -179,6 +179,8 @@ public class AINodeBasicIT {
public void callInferenceTest() {
String sql = "CALL INFERENCE(identity, \"select s0,s1,s2 from root.AI.data\")";
String sql2 = "CALL INFERENCE(identity, \"select s2,s0,s1 from root.AI.data\")";
+ String sql3 =
+ "CALL INFERENCE(_NaiveForecaster, \"select s0 from root.AI.data\", predict_length=3)";
try (Connection connection = EnvFactory.getEnv().getConnection();
Statement statement = connection.createStatement()) {
@@ -215,6 +217,17 @@ public class AINodeBasicIT {
}
assertEquals(7, count);
}
+
+ try (ResultSet resultSet = statement.executeQuery(sql3)) {
+ ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+ checkHeader(resultSetMetaData, "output0,output1,output2");
+ int count = 0;
+ while (resultSet.next()) {
+ count++;
+ }
+ assertEquals(3, count);
+ }
+
} catch (SQLException e) {
fail(e.getMessage());
}
diff --git a/iotdb-core/ainode/iotdb/ainode/model/built_in_model_factory.py b/iotdb-core/ainode/iotdb/ainode/model/built_in_model_factory.py
index 3854ba4e367..82443012176 100644
--- a/iotdb-core/ainode/iotdb/ainode/model/built_in_model_factory.py
+++ b/iotdb-core/ainode/iotdb/ainode/model/built_in_model_factory.py
@@ -99,7 +99,7 @@ def fetch_built_in_model(model_id, inference_attributes):
else:
raise BuiltInModelNotSupportError(model_id)
- return model, attributes
+ return model
class Attribute(object):