[Bug] 多设备查询最新值报错
- Ngôn ngữ chính
- Java
- Star
- 6.4k
- Fork
- 1.2k
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 115
Mô tả
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/iotdb/issues) and found nothing similar.
### Version
1.0.1
### Describe the bug and provide the minimal reproduce step
查询多设备最新值
select last 进水COD, `11`, CO2, 水管流速, 膜产水状态, 功能码, TJCTSB1_Manual_start, TJCTSB1_Manual_stop, JCS_In_TN from root.ln_1.tb_6340, root.ln_1.tb_0014, root.ln_1.tb_6141
### What did you expect to see?
正确结果
### What did you see instead?
Msg: 301: null
2023-03-17 16:05:46,526 [Query-Worker-Thread-11$20230317_080546_52613_1.1.0] WARN o.a.i.d.m.e.s.AbstractDriverThread:80 - [ExecuteFailed]
java.lang.NullPointerException: null
at org.apache.iotdb.db.mpp.execution.operator.process.last.LastQueryUtil.appendLastValue(LastQueryUtil.java:108)
at org.apache.iotdb.db.mpp.execution.operator.process.last.LastQueryMergeOperator.next(LastQueryMergeOperator.java:171)
at org.apache.iotdb.db.mpp.execution.driver.Driver.processInternal(Driver.java:193)
at org.apache.iotdb.db.mpp.execution.driver.Driver.lambda$processFor$1(Driver.java:131)
at org.apache.iotdb.db.mpp.execution.driver.Driver.tryWithLock(Driver.java:277)
at org.apache.iotdb.db.mpp.execution.driver.Driver.processFor(Driver.java:112)
at org.apache.iotdb.db.mpp.execution.schedule.DriverTaskThread.execute(DriverTaskThread.java:64)
at org.apache.iotdb.db.mpp.execution.schedule.AbstractDriverThread.run(AbstractDriverThread.java:74)
2023-03-17 16:05:46,527 [pool-30-IoTDB-ClientRPC-Processor-6] WARN o.a.i.d.u.ErrorHandlingUtils:90 - Status code: 301, Query Statement: "select last 进水COD, CO2, 水管流速, 膜产水状态, 功能码, TJCTSB1_Manual_start, TJCTSB1_Manual_stop, JCS_In_TN from root.ln_1.tb_6340, root.ln_1.tb_0014, root.ln_1.tb_6141". executeStatement failed
org.apache.iotdb.commons.exception.IoTDBException: java.lang.NullPointerException
at org.apache.iotdb.db.mpp.plan.execution.QueryExecution.dealWithException(QueryExecution.java:428)
at org.apache.iotdb.db.mpp.plan.execution.QueryExecution.getResult(QueryExecution.java:411)
at org.apache.iotdb.db.mpp.plan.execution.QueryExecution.getByteBufferBatchResult(QueryExecution.java:446)
at org.apache.iotdb.db.utils.QueryDataSetUtils.convertQueryResultByFetchSize(QueryDataSetUtils.java:387)
at org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl.lambda$static$0(ClientRPCServiceImpl.java:162)
at org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl.executeStatementInternal(ClientRPCServiceImpl.java:240)
at org.apache.iotdb.db.service.thrift.impl.ClientRPCServiceImpl.executeStatementV2(ClientRPCServiceImpl.java:398)
at org.apache.iotdb.service.rpc.thrift.IClientRPCService$Processor$executeStatementV2.getResult(IClientRPCService.java:3509)
at org.apache.iotdb.service.rpc.thrift.IClientRPCService$Processor$executeStatementV2.getResult(IClientRPCService.java:3489)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:38)
at org.apache.iotdb.db.service.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:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.NullPointerException: null
at org.apache.iotdb.db.mpp.execution.operator.process.last.LastQueryUtil.appendLastValue(LastQueryUtil.java:108)
at org.apache.iotdb.db.mpp.execution.operator.process.last.LastQueryMergeOperator.next(LastQueryMergeOperator.java:171)
at org.apache.iotdb.db.mpp.execution.driver.Driver.processInternal(Driver.java:193)
at org.apache.iotdb.db.mpp.execution.driver.Driver.lambda$processFor$1(Driver.java:131)
at org.apache.iotdb.db.mpp.execution.driver.Driver.tryWithLock(Driver.java:277)
at org.apache.iotdb.db.mpp.execution.driver.Driver.processFor(Driver.java:112)
at org.apache.iotdb.db.mpp.execution.schedule.DriverTaskThread.execute(DriverTaskThread.java:64)
at org.apache.iotdb.db.mpp.execution.schedule.AbstractDriverThread.run(AbstractDriverThread.java:74)
### Anything else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu với LastQueryUtil.java ở dòng 108 và theo dõi cách LastQueryMergeOperator.java ở dòng 171 xử lý truy vấn LAST trên nhiều thiết bị. Tái hiện SQL được báo cáo với IoTDB 1.0.1 hoặc một thiết lập tương đương, sau đó xác minh rằng truy vấn trả về các giá trị mới nhất chính xác mà không có NullPointerException.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, sql
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 38/100