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

Caideyipi pushed a commit to branch fix-fast-last-empty-cache-placeholder
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 3f35dc91b016a7b0d5ad31a0283d87d9dc59c4fc
Author: Caideyipi <[email protected]>
AuthorDate: Fri May 22 10:49:42 2026 +0800

    Fix fast last empty cache handling
---
 .../org/apache/iotdb/rest/protocol/v2/impl/RestApiServiceImpl.java   | 5 +++++
 .../apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java   | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/impl/RestApiServiceImpl.java
 
b/external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/impl/RestApiServiceImpl.java
index 2f39d6cc79d..6afd56c7fcb 100644
--- 
a/external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/impl/RestApiServiceImpl.java
+++ 
b/external-service-impl/rest/src/main/java/org/apache/iotdb/rest/protocol/v2/impl/RestApiServiceImpl.java
@@ -34,6 +34,7 @@ import 
org.apache.iotdb.db.queryengine.plan.analyze.schema.ISchemaFetcher;
 import org.apache.iotdb.db.queryengine.plan.execution.ExecutionResult;
 import org.apache.iotdb.db.queryengine.plan.execution.IQueryExecution;
 import org.apache.iotdb.db.queryengine.plan.parser.StatementGenerator;
+import 
org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TableDeviceLastCache;
 import 
org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TableDeviceSchemaCache;
 import 
org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TableId;
 import org.apache.iotdb.db.queryengine.plan.statement.Statement;
@@ -196,6 +197,10 @@ public class RestApiServiceImpl extends RestApiService {
           for (final Map.Entry<String, Pair<TSDataType, TimeValuePair>> 
measurementLastEntry :
               device2MeasurementLastEntry.getValue().entrySet()) {
             final TimeValuePair tvPair = 
measurementLastEntry.getValue().getRight();
+            if (tvPair == TableDeviceLastCache.PLACEHOLDER_EMPTY_COLUMN
+                || tvPair.getValue() == null) {
+              continue;
+            }
             valueList.add(tvPair.getValue().getStringValue());
             dataTypeList.add(tvPair.getValue().getDataType().name());
             targetDataSet.addTimestampsItem(tvPair.getTimestamp());
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
index 25b7362d8aa..bc253c05ac8 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/ClientRPCServiceImpl.java
@@ -1399,7 +1399,8 @@ public class ClientRPCServiceImpl implements 
IClientRPCServiceWithHandler {
             if (timeValuePair == null) {
               allCached = false;
               break;
-            } else if (timeValuePair.getValue() == null) {
+            } else if (timeValuePair == 
TableDeviceLastCache.PLACEHOLDER_EMPTY_COLUMN
+                || timeValuePair.getValue() == null) {
               // there is no data for this sensor
               if (!canUseNullEntry) {
                 allCached = false;

Reply via email to