This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 0eddc710cdf Revert "Fix process of last query if intermediate state of
last cache is read when query concurrently"
0eddc710cdf is described below
commit 0eddc710cdff2dfd85e50ec7c10bd0e534ff1077
Author: Jackie Tien <[email protected]>
AuthorDate: Sat Jun 7 10:45:55 2025 +0800
Revert "Fix process of last query if intermediate state of last cache is
read when query concurrently"
---
.../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,