apache / apache/iotdb

[Bug] IoTDB Gaussian_HMM/GMM_HMM Inference Model Execution Error: Data Type Conversion Exception

オープン
#16,346 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
6.4k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
115

説明

### Search before asking

- [x] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.

### Version

CentOS Linux release 7.9.2009, IoTDB 2.0.5

### Describe the bug and provide the minimal reproduce step

```sql
IoTDB> show TIMESERIES root.db.sensor.tmp.device_100.**
+-------------------------------------------------+-----+-----------+--------+--------+-----------+----+----------+--------+------------------+--------+
| Timeseries|Alias| Database|DataType|Encoding|Compression|Tags|Attributes|Deadband|DeadbandParameters|ViewType|
+-------------------------------------------------+-----+-----------+--------+--------+-----------+----+----------+--------+------------------+--------+
| root.db.sensor.tmp.device_100.val| null|root.db| DOUBLE| GORILLA| LZ4|null| null| null| null| BASE|
+-------------------------------------------------+-----+-----------+--------+--------+-----------+----+----------+--------+------------------+--------+
```

```sql
IoTDB> CALL INFERENCE(gaussian_hmm, "select val from root.db.sensor.tmp.device_100.val where time >= now()-2h and time <=
now()-1h", generateTime=true)
Msg: org.apache.iotdb.jdbc.IoTDBSQLException: 301: Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
```

```sql
IoTDB> CALL INFERENCE(gmm_hmm, "select val from root.db.sensor.tmp.device_100.val where time >= now()-2h and time <= now(
)-1h", generateTime=true)
Msg: org.apache.iotdb.jdbc.IoTDBSQLException: 301: Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
```

### What did you expect to see?

Can normally call Gaussian_HMM/GMM_HMM machine learning models

### What did you see instead?

Can normally call Gaussian_HMM/GMM_HMM machine learning models

### Anything else?

IoTDB datanode log

```log
2025-09-04 17:06:24,881 [Query-Worker-Thread-1$20250904_090624_13222_1.1.0.0] WARN o.a.i.d.q.e.s.AbstractDriverThread:95 - [ExecuteFailed]
org.apache.iotdb.db.exception.runtime.ModelInferenceProcessException: Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
at org.apache.iotdb.db.queryengine.execution.operator.process.ai.InferenceOperator.next(InferenceOperator.java:201)
at org.apache.iotdb.db.queryengine.execution.operator.Operator.nextWithTimer(Operator.java:48)
at org.apache.iotdb.db.queryengine.execution.operator.sink.IdentitySinkOperator.next(IdentitySinkOperator.java:106)
at org.apache.iotdb.db.queryengine.execution.operator.Operator.nextWithTimer(Operator.java:48)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.processInternal(Driver.java:241)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.lambda$processFor$1(Driver.java:152)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.tryWithLock(Driver.java:337)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.processFor(Driver.java:133)
at org.apache.iotdb.db.queryengine.execution.schedule.DriverTaskThread.execute(DriverTaskThread.java:83)
at org.apache.iotdb.db.queryengine.execution.schedule.AbstractDriverThread.run(AbstractDriverThread.java:79)
2025-09-04 17:06:24,881 [Query-Worker-Thread-1$20250904_090624_13222_1.1.0.0] INFO o.a.i.d.q.e.s.DriverScheduler$Scheduler:581 - The task 20250904_090624_13222_1.1.0.0 is aborted. All other tasks in the same query will be cancelled
2025-09-04 17:06:24,881 [pool-54-IoTDB-ClientRPC-Processor-15] WARN o.a.i.d.u.ErrorHandlingUtils:126 - Status code: 301, Query Statement: "CALL INFERENCE(gaussian_hmm, "select val from root.db.sensor.tmp.device_100 where time >= now()-2h and time <= now()-1h", generateTime=true)". executeStatement failed because Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
org.apache.iotdb.commons.exception.IoTDBException: org.apache.iotdb.db.exception.runtime.ModelInferenceProcessException: Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
at org.apache.iotdb.db.queryengine.plan.execution.QueryExecution.dealWithException(QueryExecution.java:479)
at org.apache.iotdb.db.queryengine.plan.execution.QueryExecution.getResult(QueryExecution.java:452)
at org.apache.iotdb.db.queryengine.plan.execution.QueryExecution.getByteBufferBatchResult(QueryExecution.java:498)
at org.apache.iotdb.db.utils.QueryDataSetUtils.convertQueryResultByFetchSize(QueryDataSetUtils.java:619)
at org.apache.iotdb.db.protocol.thrift.impl.ClientRPCServiceImpl.lambda$static$0(ClientRPCServiceImpl.java:283)
at org.apache.iotdb.db.protocol.thrift.impl.ClientRPCServiceImpl.executeStatementInternal(ClientRPCServiceImpl.java:430)
at org.apache.iotdb.db.protocol.thrift.impl.ClientRPCServiceImpl.executeStatementV2(ClientRPCServiceImpl.java:919)
at org.apache.iotdb.service.rpc.thrift.IClientRPCService$Processor$executeStatementV2.getResult(IClientRPCService.java:4164)
at org.apache.iotdb.service.rpc.thrift.IClientRPCService$Processor$executeStatementV2.getResult(IClientRPCService.java:4144)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38)
at org.apache.iotdb.db.protocol.thrift.ProcessorWithMetrics.process(ProcessorWithMetrics.java:64)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:248)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: org.apache.iotdb.db.exception.runtime.ModelInferenceProcessException: Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
at org.apache.iotdb.db.queryengine.execution.operator.process.ai.InferenceOperator.next(InferenceOperator.java:201)
at org.apache.iotdb.db.queryengine.execution.operator.Operator.nextWithTimer(Operator.java:48)
at org.apache.iotdb.db.queryengine.execution.operator.sink.IdentitySinkOperator.next(IdentitySinkOperator.java:106)
at org.apache.iotdb.db.queryengine.execution.operator.Operator.nextWithTimer(Operator.java:48)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.processInternal(Driver.java:241)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.lambda$processFor$1(Driver.java:152)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.tryWithLock(Driver.java:337)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.processFor(Driver.java:133)
at org.apache.iotdb.db.queryengine.execution.schedule.DriverTaskThread.execute(DriverTaskThread.java:83)
at org.apache.iotdb.db.queryengine.execution.schedule.AbstractDriverThread.run(AbstractDriverThread.java:79)
2025-09-04 17:06:25,882 [pool-47-IoTDB-MPP-Coordinator-Scheduled-Executor-2] WARN o.a.i.d.q.e.f.FragmentInstanceContext:440 - [Unknown exception]:
org.apache.iotdb.db.exception.runtime.ModelInferenceProcessException: Error occurred while executing inference:[Inference model internal error: int() argument must be a string, a bytes-like object or a real number, not 'pandas._libs.interval.Interval']
at org.apache.iotdb.db.queryengine.execution.operator.process.ai.InferenceOperator.next(InferenceOperator.java:201)
at org.apache.iotdb.db.queryengine.execution.operator.Operator.nextWithTimer(Operator.java:48)
at org.apache.iotdb.db.queryengine.execution.operator.sink.IdentitySinkOperator.next(IdentitySinkOperator.java:106)
at org.apache.iotdb.db.queryengine.execution.operator.Operator.nextWithTimer(Operator.java:48)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.processInternal(Driver.java:241)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.lambda$processFor$1(Driver.java:152)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.tryWithLock(Driver.java:337)
at org.apache.iotdb.db.queryengine.execution.driver.Driver.processFor(Driver.java:133)
at org.apache.iotdb.db.queryengine.execution.schedule.DriverTaskThread.execute(DriverTaskThread.java:83)
at org.apache.iotdb.db.queryengine.execution.schedule.AbstractDriverThread.run(AbstractDriverThread.java:79)
```

### Are you willing to submit a PR?

- [ ] I'm willing to submit a PR!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

CALL INFERENCE エントリーポイントと InferenceOperator.java:201 から開始し、IoTDB 2.0.5 で gaussian_hmm と gmm_hmm クエリを再現して、datanode のログに示されている pandas Interval の変換エラーに注目します。完了条件は、両方の inference 呼び出しが報告された例外なしに正常に実行されることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java, pandas, sql
領域
backend, databases, machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。