This is an automated email from the ASF dual-hosted git repository. jackietien pushed a commit to branch CacheHit in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 75cbebfd32475e4503404c871f1e9ef1d5c5f543 Author: JackieTien97 <[email protected]> AuthorDate: Fri Jun 6 17:57:24 2025 +0800 Revert "Fix process of last query if intermediate state of last cache is read when query concurrently" This reverts commit d16ec65b70a6ed9b3619c3c9ae0add2dd6afcc38. --- .../source/relational/LastQueryAggTableScanOperator.java | 10 ++++++++-- .../db/queryengine/plan/planner/TableOperatorGenerator.java | 2 -- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java index b078d7f2f34..9b34de4b7dd 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/source/relational/LastQueryAggTableScanOperator.java @@ -252,8 +252,14 @@ public class LastQueryAggTableScanOperator extends AbstractAggTableScanOperator hitCachedResults.get(currentHitCacheIndex).getRight()[measurementIdx]; long lastByTime = hitCachedResults.get(currentHitCacheIndex).getLeft().getAsLong(); if (tsPrimitiveType == EMPTY_PRIMITIVE_TYPE) { - throw new IllegalStateException( - "If the read value is [EMPTY_PRIMITIVE_TYPE], we should never reach here"); + // there is no data for this time series + if (aggregator.getStep().isOutputPartial()) { + columnBuilder.writeBinary( + new Binary( + serializeTimeValue(getTSDataType(schema.getType()), lastByTime, true, null))); + } else { + columnBuilder.appendNull(); + } } else { if (aggregator.getStep().isOutputPartial()) { columnBuilder.writeBinary( 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 82a7adc131e..c24913353fa 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 @@ -305,7 +305,6 @@ import static org.apache.iotdb.db.queryengine.plan.planner.OperatorTreeGenerator import static org.apache.iotdb.db.queryengine.plan.planner.OperatorTreeGenerator.getLinearFill; import static org.apache.iotdb.db.queryengine.plan.planner.OperatorTreeGenerator.getPreviousFill; import static org.apache.iotdb.db.queryengine.plan.planner.plan.parameter.SeriesScanOptions.updateFilterUsingTTL; -import static org.apache.iotdb.db.queryengine.plan.relational.metadata.fetcher.cache.TableDeviceLastCache.EMPTY_PRIMITIVE_TYPE; import static org.apache.iotdb.db.queryengine.plan.relational.planner.SortOrder.ASC_NULLS_FIRST; import static org.apache.iotdb.db.queryengine.plan.relational.planner.SortOrder.ASC_NULLS_LAST; import static org.apache.iotdb.db.queryengine.plan.relational.planner.SortOrder.DESC_NULLS_FIRST; @@ -2985,7 +2984,6 @@ public class TableOperatorGenerator extends PlanVisitor<Operator, LocalExecution for (int j = 0; j < lastByResult.get().getRight().length; j++) { TsPrimitiveType tsPrimitiveType = lastByResult.get().getRight()[j]; if (tsPrimitiveType == null - || tsPrimitiveType == EMPTY_PRIMITIVE_TYPE || (updateTimeFilter != null && !LastQueryUtil.satisfyFilter( updateTimeFilter,
