This is an automated email from the ASF dual-hosted git repository. shuwenwei pushed a commit to branch fixLastQueryBug-0123-1.3 in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 0e274ca41797a4f2e13561ede5cf4d8cfd5f8c32 Author: shuwenwei <[email protected]> AuthorDate: Fri Jan 23 17:58:52 2026 +0800 fix last query bug --- .../execution/operator/process/last/LastQueryOperator.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/last/LastQueryOperator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/last/LastQueryOperator.java index dd41bbd7afa..d2389a00898 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/last/LastQueryOperator.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/last/LastQueryOperator.java @@ -112,12 +112,10 @@ public class LastQueryOperator implements ProcessOperator { && !tsBlockBuilder.isFull()) { if (children.get(currentIndex).hasNextWithTimer()) { TsBlock tsBlock = children.get(currentIndex).nextWithTimer(); - if (tsBlock == null) { - return null; - } else if (!tsBlock.isEmpty()) { + if (tsBlock != null && !tsBlock.isEmpty()) { LastQueryUtil.appendLastValue(tsBlockBuilder, tsBlock); - return null; } + return null; } else { children.get(currentIndex).close(); children.set(currentIndex, null);
