This is an automated email from the ASF dual-hosted git repository.

weihao pushed a commit to branch fixInit
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit d4a26222f72bb481c04d82e601789f97b912adaa
Author: Weihao Li <[email protected]>
AuthorDate: Wed Jan 28 10:37:55 2026 +0800

    fix init time
    
    Signed-off-by: Weihao Li <[email protected]>
---
 .../relational/it/query/recent/IoTDBTableAggregationIT.java      | 9 +++++++++
 .../db/queryengine/plan/planner/TableOperatorGenerator.java      | 6 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
index 88367283eb7..546754e06f8 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/relational/it/query/recent/IoTDBTableAggregationIT.java
@@ -2498,6 +2498,15 @@ public class IoTDBTableAggregationIT {
         DATABASE_NAME,
         2);
 
+    expectedHeader = new String[] {"device_id", "_col1"};
+    retArray = new String[] {"d01,0xcafebabe55,", "d02,0xcafebabe50,"};
+    repeatTest(
+            "select device_id, last(s8) from table1 where device_id = 'd01' or 
device_id = 'd02' group by device_id order by device_id",
+            expectedHeader,
+            retArray,
+            DATABASE_NAME,
+            2);
+
     expectedHeader =
         new String[] {
           "_col0", "_col1", "_col2", "_col3", "_col4", "_col5", "_col6", 
"_col7", "_col8", "_col9",
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
index 9c8dade73a8..190ffd0701f 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/TableOperatorGenerator.java
@@ -3247,9 +3247,9 @@ public class TableOperatorGenerator extends 
PlanVisitor<Operator, LocalExecution
               .initOrInvalidateLastCache(
                   node.getQualifiedObjectName().getDatabaseName(),
                   deviceEntry.getDeviceID(),
-                  needInitTime && node.getGroupingKeys().isEmpty()
-                      ? Arrays.copyOfRange(targetColumns, 0, 
targetColumns.length - 1)
-                      : targetColumns,
+                  needInitTime
+                      ? targetColumns
+                      : Arrays.copyOfRange(targetColumns, 0, 
targetColumns.length - 1),
                   false);
         } else {
           hitCachesIndexes.add(i);

Reply via email to