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

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


The following commit(s) were added to refs/heads/addQueryDebug by this push:
     new f6d0748ff37 BE and verify passed
f6d0748ff37 is described below

commit f6d0748ff376b5330ad5334f37054b507350052f
Author: Weihao Li <[email protected]>
AuthorDate: Thu Feb 5 17:57:58 2026 +0800

    BE and verify passed
    
    Signed-off-by: Weihao Li <[email protected]>
---
 .../protocol/thrift/impl/ClientRPCServiceImpl.java |  4 +-
 .../fragment/FakedFragmentInstanceContext.java     |  2 +-
 .../fragment/FragmentInstanceContext.java          | 48 +++++++++++++++-------
 .../fragment/FragmentInstanceManager.java          |  8 +++-
 .../execution/fragment/QueryContext.java           | 10 +++--
 .../iotdb/db/queryengine/plan/Coordinator.java     |  2 +-
 .../analyze/schema/ClusterSchemaFetchExecutor.java |  2 +-
 .../SimpleFragmentParallelPlanner.java             |  1 +
 .../distribution/WriteFragmentParallelPlanner.java |  3 +-
 .../plan/planner/plan/FragmentInstance.java        | 32 ++++++++++++---
 .../metadata/fetcher/TableDeviceSchemaFetcher.java |  2 +-
 .../plan/relational/planner/CteMaterializer.java   |  2 +-
 .../distribute/TableModelQueryFragmentPlanner.java |  1 +
 .../plan/scheduler/load/LoadTsFileScheduler.java   |  6 ++-
 .../plan/planner/FragmentInstanceSerdeTest.java    |  6 ++-
 .../relational/planner/CteMaterializerTest.java    |  3 +-
 .../plan/relational/planner/CteSubqueryTest.java   |  3 +-
 .../memtable/MemChunkDeserializeTest.java          |  4 +-
 .../dataregion/memtable/PrimitiveMemTableTest.java | 19 +++++----
 .../reader/chunk/MemAlignedChunkLoaderTest.java    |  2 +-
 .../read/reader/chunk/MemChunkLoaderTest.java      | 12 +++---
 .../wal/recover/file/TsFilePlanRedoerTest.java     | 21 ++++++----
 .../apache/iotdb/db/utils/EnvironmentUtils.java    |  4 +-
 .../db/relational/grammar/sql/RelationalSql.g4     |  3 +-
 24 files changed, 131 insertions(+), 69 deletions(-)

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 45eb4f027a7..ec7fa33e96f 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
@@ -389,7 +389,7 @@ public class ClientRPCServiceImpl implements 
IClientRPCServiceWithHandler {
                     schemaFetcher,
                     req.getTimeout(),
                     true,
-                    false);
+                    s.isDebug());
           }
         }
       } else {
@@ -437,7 +437,7 @@ public class ClientRPCServiceImpl implements 
IClientRPCServiceWithHandler {
                   metadata,
                   req.getTimeout(),
                   true,
-                  false);
+                  s.isDebug());
         }
       }
 
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FakedFragmentInstanceContext.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FakedFragmentInstanceContext.java
index 26bfb723917..bdebbc9f289 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FakedFragmentInstanceContext.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FakedFragmentInstanceContext.java
@@ -35,7 +35,7 @@ import java.util.List;
 public class FakedFragmentInstanceContext extends FragmentInstanceContext {
 
   public FakedFragmentInstanceContext(Filter timeFilter, DataRegion 
dataRegion) {
-    super(0, new FakedMemoryReservationManager(), timeFilter, dataRegion);
+    super(0, new FakedMemoryReservationManager(), timeFilter, dataRegion, 
false);
   }
 
   public QueryDataSource getSharedQueryDataSource(IFullPath sourcePath)
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
index 1a1b426006a..bb16bf73c16 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
@@ -163,9 +163,12 @@ public class FragmentInstanceContext extends QueryContext {
   private long closedUnseqFileNum = 0;
 
   public static FragmentInstanceContext createFragmentInstanceContext(
-      FragmentInstanceId id, FragmentInstanceStateMachine stateMachine, 
SessionInfo sessionInfo) {
+      FragmentInstanceId id,
+      FragmentInstanceStateMachine stateMachine,
+      SessionInfo sessionInfo,
+      boolean debug) {
     FragmentInstanceContext instanceContext =
-        new FragmentInstanceContext(id, stateMachine, sessionInfo);
+        new FragmentInstanceContext(id, stateMachine, sessionInfo, debug);
     instanceContext.initialize();
     instanceContext.start();
     return instanceContext;
@@ -177,9 +180,10 @@ public class FragmentInstanceContext extends QueryContext {
       FragmentInstanceStateMachine stateMachine,
       SessionInfo sessionInfo,
       IDataRegionForQuery dataRegion,
-      Filter timeFilter) {
+      Filter timeFilter,
+      boolean debug) {
     FragmentInstanceContext instanceContext =
-        new FragmentInstanceContext(id, stateMachine, sessionInfo, dataRegion, 
timeFilter);
+        new FragmentInstanceContext(id, stateMachine, sessionInfo, dataRegion, 
timeFilter, debug);
     instanceContext.initialize();
     instanceContext.start();
     return instanceContext;
@@ -191,7 +195,8 @@ public class FragmentInstanceContext extends QueryContext {
       SessionInfo sessionInfo,
       IDataRegionForQuery dataRegion,
       TimePredicate globalTimePredicate,
-      Map<QueryId, DataNodeQueryContext> dataNodeQueryContextMap) {
+      Map<QueryId, DataNodeQueryContext> dataNodeQueryContextMap,
+      boolean debug) {
     FragmentInstanceContext instanceContext =
         new FragmentInstanceContext(
             id,
@@ -199,14 +204,15 @@ public class FragmentInstanceContext extends QueryContext 
{
             sessionInfo,
             dataRegion,
             globalTimePredicate,
-            dataNodeQueryContextMap);
+            dataNodeQueryContextMap,
+            debug);
     instanceContext.initialize();
     instanceContext.start();
     return instanceContext;
   }
 
   public static FragmentInstanceContext 
createFragmentInstanceContextForCompaction(long queryId) {
-    return new FragmentInstanceContext(queryId, null, null, null);
+    return new FragmentInstanceContext(queryId, null, null, null, false);
   }
 
   public void setQueryDataSourceType(QueryDataSourceType queryDataSourceType) {
@@ -220,7 +226,8 @@ public class FragmentInstanceContext extends QueryContext {
         new FragmentInstanceContext(
             id,
             stateMachine,
-            new SessionInfo(1, new UserEntity(666, "test", "127.0.0.1"), 
ZoneId.systemDefault()));
+            new SessionInfo(1, new UserEntity(666, "test", "127.0.0.1"), 
ZoneId.systemDefault()),
+            false);
     instanceContext.initialize();
     instanceContext.start();
     return instanceContext;
@@ -236,7 +243,8 @@ public class FragmentInstanceContext extends QueryContext {
             id,
             stateMachine,
             new SessionInfo(1, new UserEntity(666, "test", "127.0.0.1"), 
ZoneId.systemDefault()),
-            memoryReservationManager);
+            memoryReservationManager,
+            false);
     instanceContext.initialize();
     instanceContext.start();
     return instanceContext;
@@ -248,7 +256,9 @@ public class FragmentInstanceContext extends QueryContext {
       SessionInfo sessionInfo,
       IDataRegionForQuery dataRegion,
       TimePredicate globalTimePredicate,
-      Map<QueryId, DataNodeQueryContext> dataNodeQueryContextMap) {
+      Map<QueryId, DataNodeQueryContext> dataNodeQueryContextMap,
+      boolean debug) {
+    super(debug);
     this.id = id;
     this.stateMachine = stateMachine;
     this.executionEndTime.set(END_TIME_INITIAL_VALUE);
@@ -266,7 +276,11 @@ public class FragmentInstanceContext extends QueryContext {
   }
 
   private FragmentInstanceContext(
-      FragmentInstanceId id, FragmentInstanceStateMachine stateMachine, 
SessionInfo sessionInfo) {
+      FragmentInstanceId id,
+      FragmentInstanceStateMachine stateMachine,
+      SessionInfo sessionInfo,
+      boolean debug) {
+    super(debug);
     this.id = id;
     this.stateMachine = stateMachine;
     this.executionEndTime.set(END_TIME_INITIAL_VALUE);
@@ -281,7 +295,9 @@ public class FragmentInstanceContext extends QueryContext {
       FragmentInstanceId id,
       FragmentInstanceStateMachine stateMachine,
       SessionInfo sessionInfo,
-      MemoryReservationManager memoryReservationManager) {
+      MemoryReservationManager memoryReservationManager,
+      boolean debug) {
+    super(debug);
     this.id = id;
     this.stateMachine = stateMachine;
     this.executionEndTime.set(END_TIME_INITIAL_VALUE);
@@ -296,7 +312,9 @@ public class FragmentInstanceContext extends QueryContext {
       FragmentInstanceStateMachine stateMachine,
       SessionInfo sessionInfo,
       IDataRegionForQuery dataRegion,
-      Filter globalTimeFilter) {
+      Filter globalTimeFilter,
+      boolean debug) {
+    super(debug);
     this.id = id;
     this.stateMachine = stateMachine;
     this.executionEndTime.set(END_TIME_INITIAL_VALUE);
@@ -318,7 +336,9 @@ public class FragmentInstanceContext extends QueryContext {
       long queryId,
       MemoryReservationManager memoryReservationManager,
       Filter timeFilter,
-      DataRegion dataRegion) {
+      DataRegion dataRegion,
+      boolean debug) {
+    super(debug);
     this.queryId = queryId;
     this.id = null;
     this.stateMachine = null;
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceManager.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceManager.java
index 82ec29cc77c..7b5fbe37571 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceManager.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceManager.java
@@ -159,7 +159,8 @@ public class FragmentInstanceManager {
                                 instance.getSessionInfo(),
                                 dataRegion,
                                 instance.getGlobalTimePredicate(),
-                                dataNodeQueryContextMap));
+                                dataNodeQueryContextMap,
+                                instance.isDebug()));
 
                 try {
                   List<PipelineDriverFactory> driverFactories =
@@ -269,7 +270,10 @@ public class FragmentInstanceManager {
                       instanceId,
                       fragmentInstanceId ->
                           createFragmentInstanceContext(
-                              fragmentInstanceId, stateMachine, 
instance.getSessionInfo()));
+                              fragmentInstanceId,
+                              stateMachine,
+                              instance.getSessionInfo(),
+                              instance.isDebug()));
 
               try {
                 List<PipelineDriverFactory> driverFactories =
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/QueryContext.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/QueryContext.java
index 2abb5ac5179..f165db769e9 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/QueryContext.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/QueryContext.java
@@ -63,7 +63,7 @@ public class QueryContext {
 
   protected long queryId;
 
-  private boolean debug;
+  private final boolean debug;
 
   private long startTime;
   private long timeout;
@@ -79,10 +79,12 @@ public class QueryContext {
 
   protected Set<String> tables;
 
-  public QueryContext() {}
+  public QueryContext(boolean debug) {
+    this.debug = debug;
+  }
 
-  public QueryContext(long queryId) {
-    this(queryId, false, System.currentTimeMillis(), 0);
+  public QueryContext(long queryId, boolean debug) {
+    this(queryId, debug, System.currentTimeMillis(), 0);
   }
 
   /** Every time we generate the queryContext, register it to 
queryTimeManager. */
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
index af5f208d331..ed251f91e7e 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/Coordinator.java
@@ -355,7 +355,7 @@ public class Coordinator {
         schemaFetcher,
         Long.MAX_VALUE,
         false,
-        false);
+        statement.isDebug());
   }
 
   public ExecutionResult executeForTreeModel(
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ClusterSchemaFetchExecutor.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ClusterSchemaFetchExecutor.java
index 5d6d36d4609..779503a5dc5 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ClusterSchemaFetchExecutor.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/analyze/schema/ClusterSchemaFetchExecutor.java
@@ -99,7 +99,7 @@ class ClusterSchemaFetchExecutor {
         schemaFetcher,
         timeout,
         false,
-        false);
+        statement.isDebug());
   }
 
   /**
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SimpleFragmentParallelPlanner.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SimpleFragmentParallelPlanner.java
index 334d1973f53..86fa1211911 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SimpleFragmentParallelPlanner.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/SimpleFragmentParallelPlanner.java
@@ -144,6 +144,7 @@ public class SimpleFragmentParallelPlanner extends 
AbstractFragmentParallelPlann
             queryContext.getTimeOut() - (System.currentTimeMillis() - 
queryContext.getStartTime()),
             queryContext.getSession(),
             queryContext.isExplainAnalyze(),
+            queryContext.isDebug(),
             fragment.isRoot());
 
     selectExecutorAndHost(
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/WriteFragmentParallelPlanner.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/WriteFragmentParallelPlanner.java
index 1e5c0567825..a5d4a33cac0 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/WriteFragmentParallelPlanner.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/distribution/WriteFragmentParallelPlanner.java
@@ -81,7 +81,8 @@ public class WriteFragmentParallelPlanner implements 
IFragmentParallelPlaner {
               queryContext.getQueryType(),
               // Never timeout for write
               Long.MAX_VALUE,
-              queryContext.getSession());
+              queryContext.getSession(),
+              false);
       if (split.getRegionReplicaSet() != null) {
         final TRegionReplicaSet validSet =
             topology.getValidatedReplicaSet(split.getRegionReplicaSet());
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/FragmentInstance.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/FragmentInstance.java
index 69d2a77fe3e..6bf584145cf 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/FragmentInstance.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/FragmentInstance.java
@@ -79,6 +79,8 @@ public class FragmentInstance implements IConsensusRequest {
   // We need to cache and calculate the statistics of this FragmentInstance if 
it is.
   private boolean isExplainAnalyze = false;
 
+  private final boolean debug;
+
   // We can add some more params for a specific FragmentInstance
   // So that we can make different FragmentInstance owns different data range.
 
@@ -88,7 +90,8 @@ public class FragmentInstance implements IConsensusRequest {
       TimePredicate globalTimePredicate,
       QueryType type,
       long timeOut,
-      SessionInfo sessionInfo) {
+      SessionInfo sessionInfo,
+      boolean debug) {
     this.fragment = fragment;
     this.globalTimePredicate = globalTimePredicate;
     this.id = id;
@@ -96,6 +99,7 @@ public class FragmentInstance implements IConsensusRequest {
     this.timeOut = timeOut > 0 ? timeOut : CONFIG.getQueryTimeoutThreshold();
     this.isRoot = false;
     this.sessionInfo = sessionInfo;
+    this.debug = debug;
   }
 
   public FragmentInstance(
@@ -106,8 +110,9 @@ public class FragmentInstance implements IConsensusRequest {
       long timeOut,
       SessionInfo sessionInfo,
       boolean isExplainAnalyze,
+      boolean debug,
       boolean isRoot) {
-    this(fragment, id, globalTimePredicate, type, timeOut, sessionInfo);
+    this(fragment, id, globalTimePredicate, type, timeOut, sessionInfo, debug);
     this.isRoot = isRoot;
     this.isExplainAnalyze = isExplainAnalyze;
   }
@@ -119,8 +124,9 @@ public class FragmentInstance implements IConsensusRequest {
       long timeOut,
       SessionInfo sessionInfo,
       boolean isExplainAnalyze,
+      boolean debug,
       boolean isRoot) {
-    this(fragment, id, null, type, timeOut, sessionInfo);
+    this(fragment, id, null, type, timeOut, sessionInfo, debug);
     this.isRoot = isRoot;
     this.isExplainAnalyze = isExplainAnalyze;
   }
@@ -132,8 +138,9 @@ public class FragmentInstance implements IConsensusRequest {
       QueryType type,
       long timeOut,
       SessionInfo sessionInfo,
-      int dataNodeFINum) {
-    this(fragment, id, globalTimePredicate, type, timeOut, sessionInfo);
+      int dataNodeFINum,
+      boolean debug) {
+    this(fragment, id, globalTimePredicate, type, timeOut, sessionInfo, debug);
     this.dataNodeFINum = dataNodeFINum;
   }
 
@@ -200,6 +207,10 @@ public class FragmentInstance implements IConsensusRequest 
{
     this.dataNodeFINum = dataNodeFINum;
   }
 
+  public boolean isDebug() {
+    return debug;
+  }
+
   public String toString() {
     StringBuilder ret = new StringBuilder();
     ret.append(String.format("FragmentInstance-%s:", getId()));
@@ -229,9 +240,17 @@ public class FragmentInstance implements IConsensusRequest 
{
     TimePredicate globalTimePredicate = hasTimePredicate ? 
TimePredicate.deserialize(buffer) : null;
     QueryType queryType = QueryType.values()[ReadWriteIOUtils.readInt(buffer)];
     int dataNodeFINum = ReadWriteIOUtils.readInt(buffer);
+    boolean debug = ReadWriteIOUtils.readBool(buffer);
     FragmentInstance fragmentInstance =
         new FragmentInstance(
-            planFragment, id, globalTimePredicate, queryType, timeOut, 
sessionInfo, dataNodeFINum);
+            planFragment,
+            id,
+            globalTimePredicate,
+            queryType,
+            timeOut,
+            sessionInfo,
+            dataNodeFINum,
+            debug);
     boolean hasHostDataNode = ReadWriteIOUtils.readBool(buffer);
     fragmentInstance.hostDataNode =
         hasHostDataNode ? 
ThriftCommonsSerDeUtils.deserializeTDataNodeLocation(buffer) : null;
@@ -255,6 +274,7 @@ public class FragmentInstance implements IConsensusRequest {
       }
       ReadWriteIOUtils.write(type.ordinal(), outputStream);
       ReadWriteIOUtils.write(dataNodeFINum, outputStream);
+      ReadWriteIOUtils.write(debug, outputStream);
       ReadWriteIOUtils.write(hostDataNode != null, outputStream);
       if (hostDataNode != null) {
         ThriftCommonsSerDeUtils.serializeTDataNodeLocation(hostDataNode, 
outputStream);
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
index b9b59636b09..b4761d3f29c 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/metadata/fetcher/TableDeviceSchemaFetcher.java
@@ -504,7 +504,7 @@ public class TableDeviceSchemaFetcher {
               mppQueryContext.getTimeOut()
                   - (System.currentTimeMillis() - 
mppQueryContext.getStartTime()),
               false,
-              false);
+              mppQueryContext.isDebug());
 
       if (executionResult.status.getCode() != 
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
         throw new IoTDBRuntimeException(
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializer.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializer.java
index db030146a04..e83103a50e7 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializer.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializer.java
@@ -143,7 +143,7 @@ public class CteMaterializer {
               context.getExplainType(),
               context.getTimeOut(),
               false,
-              false);
+              context.isDebug());
       if (executionResult.status.getCode() != 
TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
         return null;
       }
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableModelQueryFragmentPlanner.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableModelQueryFragmentPlanner.java
index 40ed57a7fa2..8a5ce927140 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableModelQueryFragmentPlanner.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/relational/planner/distribute/TableModelQueryFragmentPlanner.java
@@ -183,6 +183,7 @@ public class TableModelQueryFragmentPlanner extends 
AbstractFragmentParallelPlan
             queryContext.getTimeOut() - (System.currentTimeMillis() - 
queryContext.getStartTime()),
             queryContext.getSession(),
             queryContext.isExplainAnalyze(),
+            queryContext.isDebug(),
             fragment.isRoot());
 
     selectExecutorAndHost(
diff --git 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileScheduler.java
 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileScheduler.java
index cf7ab8faedd..98d68328411 100644
--- 
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileScheduler.java
+++ 
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/scheduler/load/LoadTsFileScheduler.java
@@ -347,7 +347,8 @@ public class LoadTsFileScheduler implements IScheduler {
             null,
             queryContext.getQueryType(),
             queryContext.getTimeOut() - (System.currentTimeMillis() - 
queryContext.getStartTime()),
-            queryContext.getSession());
+            queryContext.getSession(),
+            queryContext.isDebug());
     instance.setExecutorAndHost(new StorageExecutor(replicaSet));
     Future<FragInstanceDispatchResult> dispatchResultFuture =
         dispatcher.dispatch(null, Collections.singletonList(instance));
@@ -500,7 +501,8 @@ public class LoadTsFileScheduler implements IScheduler {
               queryContext.getQueryType(),
               queryContext.getTimeOut()
                   - (System.currentTimeMillis() - queryContext.getStartTime()),
-              queryContext.getSession());
+              queryContext.getSession(),
+              queryContext.isDebug());
       instance.setExecutorAndHost(new 
StorageExecutor(node.getLocalRegionReplicaSet()));
       dispatcher.dispatchLocally(instance);
     } catch (FragmentInstanceDispatchException e) {
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/FragmentInstanceSerdeTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/FragmentInstanceSerdeTest.java
index 711e67682ca..3596ea550c7 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/FragmentInstanceSerdeTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/planner/FragmentInstanceSerdeTest.java
@@ -76,7 +76,8 @@ public class FragmentInstanceSerdeTest {
             new TreeModelTimePredicate(ExpressionFactory.groupByTime(1, 2, 3, 
4)),
             QueryType.READ,
             config.getQueryTimeoutThreshold(),
-            sessionInfo);
+            sessionInfo,
+            false);
     // test FI with StorageExecutor
     TRegionReplicaSet regionReplicaSet =
         new TRegionReplicaSet(
@@ -118,7 +119,8 @@ public class FragmentInstanceSerdeTest {
             null,
             QueryType.READ,
             config.getQueryTimeoutThreshold(),
-            sessionInfo);
+            sessionInfo,
+            false);
     TRegionReplicaSet regionReplicaSet =
         new TRegionReplicaSet(
             new TConsensusGroupId(TConsensusGroupType.DataRegion, 1),
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializerTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializerTest.java
index 3394b1fbb58..d568583a192 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializerTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteMaterializerTest.java
@@ -116,7 +116,8 @@ public class CteMaterializerTest {
             Mockito.anyMap(), // Map<NodeRef<Table>, CteDataStore>
             Mockito.any(), // ExplainType
             Mockito.anyLong(), // timeOut
-            Mockito.anyBoolean())) // userQuery
+            Mockito.anyBoolean(),
+            false)) // userQuery
         .thenReturn(mockResult);
   }
 
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteSubqueryTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteSubqueryTest.java
index bff1d7c93dd..1d91d6fda06 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteSubqueryTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/queryengine/plan/relational/planner/CteSubqueryTest.java
@@ -139,7 +139,8 @@ public class CteSubqueryTest {
             Mockito.anyMap(), // Map<NodeRef<Table>, CteDataStore>
             Mockito.any(), // ExplainType
             Mockito.anyLong(), // timeOut
-            Mockito.anyBoolean())) // userQuery
+            Mockito.anyBoolean(),
+            false)) // userQuery
         .thenReturn(mockResult);
 
     // Create QueryExecution mock
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/MemChunkDeserializeTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/MemChunkDeserializeTest.java
index d0edfdab330..e043da91251 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/MemChunkDeserializeTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/MemChunkDeserializeTest.java
@@ -301,7 +301,7 @@ public class MemChunkDeserializeTest {
     memTableMap.put(deviceID, memChunkGroup);
     IMemTable memTable = new PrimitiveMemTable(storageGroup, dataRegionId, 
memTableMap);
 
-    QueryContext context = new QueryContext();
+    QueryContext context = new QueryContext(false);
     NonAlignedFullPath nonAlignedFullPath =
         new NonAlignedFullPath(
             deviceID,
@@ -325,7 +325,7 @@ public class MemChunkDeserializeTest {
     memTableMap.put(deviceID, memChunkGroup);
     IMemTable memTable = new PrimitiveMemTable(storageGroup, dataRegionId, 
memTableMap);
 
-    QueryContext context = new QueryContext();
+    QueryContext context = new QueryContext(false);
     AlignedFullPath alignedFullPath = new AlignedFullPath(deviceID, 
measurementList, schemaList);
     return memTable.query(context, alignedFullPath, Long.MIN_VALUE, null, 
null);
   }
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/PrimitiveMemTableTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/PrimitiveMemTableTest.java
index b16e20d4f85..7e77abca29e 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/PrimitiveMemTableTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/memtable/PrimitiveMemTableTest.java
@@ -142,7 +142,7 @@ public class PrimitiveMemTableTest {
     tvListQueryMap.put(series.getWorkingTVList(), 
series.getWorkingTVList().rowCount());
     ReadOnlyMemChunk readableChunk =
         new ReadOnlyMemChunk(
-            new QueryContext(), "s1", dataType, TSEncoding.PLAIN, 
tvListQueryMap, null, null);
+            new QueryContext(false), "s1", dataType, TSEncoding.PLAIN, 
tvListQueryMap, null, null);
     IPointReader it = readableChunk.getPointReader();
     int i = 0;
     while (it.hasNextTimeValuePair()) {
@@ -190,7 +190,7 @@ public class PrimitiveMemTableTest {
                 measurementSchemas));
     ReadOnlyMemChunk readOnlyMemChunk =
         resourcesByPathUtils.getReadOnlyMemChunkFromMemTable(
-            new QueryContext(1), memTable, null, Long.MAX_VALUE, null);
+            new QueryContext(1, false), memTable, null, Long.MAX_VALUE, null);
 
     for (int i = 1; i <= 50; i++) {
       memTable.writeAlignedRow(
@@ -259,7 +259,7 @@ public class PrimitiveMemTableTest {
     }
 
     ReadOnlyMemChunk memChunk =
-        memTable.query(new QueryContext(), nonAlignedFullPath, Long.MIN_VALUE, 
null, null);
+        memTable.query(new QueryContext(false), nonAlignedFullPath, 
Long.MIN_VALUE, null, null);
     IPointReader iterator = memChunk.getPointReader();
     for (int i = 0; i < dataSize; i++) {
       iterator.hasNextTimeValuePair();
@@ -355,7 +355,7 @@ public class PrimitiveMemTableTest {
     modsToMemtable.add(new Pair<>(deletion, memTable));
     ReadOnlyMemChunk memChunk =
         memTable.query(
-            new QueryContext(), nonAlignedFullPath, Long.MIN_VALUE, 
modsToMemtable, null);
+            new QueryContext(false), nonAlignedFullPath, Long.MIN_VALUE, 
modsToMemtable, null);
     IPointReader iterator = memChunk.getPointReader();
     int cnt = 0;
     while (iterator.hasNextTimeValuePair()) {
@@ -400,7 +400,8 @@ public class PrimitiveMemTableTest {
         new TreeDeletionEntry(new MeasurementPath(deviceID, measurementId[0]), 
10, dataSize);
     modsToMemtable.add(new Pair<>(deletion, memTable));
     ReadOnlyMemChunk memChunk =
-        memTable.query(new QueryContext(), alignedFullPath, Long.MIN_VALUE, 
modsToMemtable, null);
+        memTable.query(
+            new QueryContext(false), alignedFullPath, Long.MIN_VALUE, 
modsToMemtable, null);
     IPointReader iterator = memChunk.getPointReader();
     int cnt = 0;
     while (iterator.hasNextTimeValuePair()) {
@@ -439,7 +440,9 @@ public class PrimitiveMemTableTest {
                 CompressionType.UNCOMPRESSED,
                 Collections.emptyMap()));
     IPointReader tvPair =
-        memTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, null, 
null).getPointReader();
+        memTable
+            .query(new QueryContext(false), fullPath, Long.MIN_VALUE, null, 
null)
+            .getPointReader();
     Arrays.sort(ret);
     TimeValuePair last = null;
     for (int i = 0; i < ret.length; i++) {
@@ -488,7 +491,7 @@ public class PrimitiveMemTableTest {
                     Collections.emptyMap())));
     IPointReader tvPair =
         memTable
-            .query(new QueryContext(), tmpAlignedFullPath, Long.MIN_VALUE, 
null, null)
+            .query(new QueryContext(false), tmpAlignedFullPath, 
Long.MIN_VALUE, null, null)
             .getPointReader();
     for (int i = 0; i < 100; i++) {
       tvPair.hasNextTimeValuePair();
@@ -517,7 +520,7 @@ public class PrimitiveMemTableTest {
 
     tvPair =
         memTable
-            .query(new QueryContext(), tmpAlignedFullPath, Long.MIN_VALUE, 
null, null)
+            .query(new QueryContext(false), tmpAlignedFullPath, 
Long.MIN_VALUE, null, null)
             .getPointReader();
     for (int i = 0; i < 100; i++) {
       tvPair.hasNextTimeValuePair();
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedChunkLoaderTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedChunkLoaderTest.java
index e8d16912896..72406a2e4a7 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedChunkLoaderTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemAlignedChunkLoaderTest.java
@@ -63,7 +63,7 @@ public class MemAlignedChunkLoaderTest {
   public void testMemAlignedChunkLoader() throws IOException {
     AlignedReadOnlyMemChunk chunk = 
Mockito.mock(AlignedReadOnlyMemChunk.class);
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    QueryContext ctx = new QueryContext();
+    QueryContext ctx = new QueryContext(false);
     MemAlignedChunkLoader memAlignedChunkLoader = new 
MemAlignedChunkLoader(ctx, chunk);
 
     try {
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemChunkLoaderTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemChunkLoaderTest.java
index 1a3ccc21bcc..986b88ec112 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemChunkLoaderTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/read/reader/chunk/MemChunkLoaderTest.java
@@ -75,7 +75,7 @@ public class MemChunkLoaderTest {
     
Mockito.when(chunk.getMemPointIterator()).thenReturn(timeValuePairIterator);
 
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    MemChunkLoader memChunkLoader = new MemChunkLoader(new QueryContext(), 
chunk);
+    MemChunkLoader memChunkLoader = new MemChunkLoader(new 
QueryContext(false), chunk);
     try {
       memChunkLoader.loadChunk(chunkMetadata);
       fail();
@@ -155,7 +155,7 @@ public class MemChunkLoaderTest {
     
Mockito.when(chunk.getMemPointIterator()).thenReturn(timeValuePairIterator);
 
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    MemChunkLoader memChunkLoader = new MemChunkLoader(new QueryContext(), 
chunk);
+    MemChunkLoader memChunkLoader = new MemChunkLoader(new 
QueryContext(false), chunk);
     try {
       memChunkLoader.loadChunk(chunkMetadata);
       fail();
@@ -235,7 +235,7 @@ public class MemChunkLoaderTest {
     
Mockito.when(chunk.getMemPointIterator()).thenReturn(timeValuePairIterator);
 
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    MemChunkLoader memChunkLoader = new MemChunkLoader(new QueryContext(), 
chunk);
+    MemChunkLoader memChunkLoader = new MemChunkLoader(new 
QueryContext(false), chunk);
     try {
       memChunkLoader.loadChunk(chunkMetadata);
       fail();
@@ -315,7 +315,7 @@ public class MemChunkLoaderTest {
     
Mockito.when(chunk.getMemPointIterator()).thenReturn(timeValuePairIterator);
 
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    MemChunkLoader memChunkLoader = new MemChunkLoader(new QueryContext(), 
chunk);
+    MemChunkLoader memChunkLoader = new MemChunkLoader(new 
QueryContext(false), chunk);
     try {
       memChunkLoader.loadChunk(chunkMetadata);
       fail();
@@ -395,7 +395,7 @@ public class MemChunkLoaderTest {
     
Mockito.when(chunk.getMemPointIterator()).thenReturn(timeValuePairIterator);
 
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    MemChunkLoader memChunkLoader = new MemChunkLoader(new QueryContext(), 
chunk);
+    MemChunkLoader memChunkLoader = new MemChunkLoader(new 
QueryContext(false), chunk);
     try {
       memChunkLoader.loadChunk(chunkMetadata);
       fail();
@@ -475,7 +475,7 @@ public class MemChunkLoaderTest {
     
Mockito.when(chunk.getMemPointIterator()).thenReturn(timeValuePairIterator);
 
     ChunkMetadata chunkMetadata = Mockito.mock(ChunkMetadata.class);
-    MemChunkLoader memChunkLoader = new MemChunkLoader(new QueryContext(), 
chunk);
+    MemChunkLoader memChunkLoader = new MemChunkLoader(new 
QueryContext(false), chunk);
     try {
       memChunkLoader.loadChunk(chunkMetadata);
       fail();
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
index 6c02cc4ba18..a86f814041a 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/storageengine/dataregion/wal/recover/file/TsFilePlanRedoerTest.java
@@ -162,7 +162,7 @@ public class TsFilePlanRedoerTest {
         new NonAlignedFullPath(
             DEVICE2_NAME, new MeasurementSchema("s1", TSDataType.FLOAT, 
TSEncoding.RLE));
     ReadOnlyMemChunk memChunk =
-        recoveryMemTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, 
null, null);
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     IPointReader iterator = memChunk.getPointReader();
     time = 5;
     while (iterator.hasNextTimeValuePair()) {
@@ -176,7 +176,8 @@ public class TsFilePlanRedoerTest {
     fullPath =
         new NonAlignedFullPath(
             DEVICE2_NAME, new MeasurementSchema("s2", TSDataType.DOUBLE, 
TSEncoding.RLE));
-    memChunk = recoveryMemTable.query(new QueryContext(), fullPath, 
Long.MIN_VALUE, null, null);
+    memChunk =
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     iterator = memChunk.getPointReader();
     time = 5;
     while (iterator.hasNextTimeValuePair()) {
@@ -262,7 +263,7 @@ public class TsFilePlanRedoerTest {
                 new MeasurementSchema("s4", TSDataType.FLOAT, TSEncoding.RLE),
                 new MeasurementSchema("s5", TSDataType.TEXT, 
TSEncoding.PLAIN)));
     ReadOnlyMemChunk memChunk =
-        recoveryMemTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, 
null, null);
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     IPointReader iterator = memChunk.getPointReader();
     int time = 6;
     while (iterator.hasNextTimeValuePair()) {
@@ -342,7 +343,7 @@ public class TsFilePlanRedoerTest {
         new NonAlignedFullPath(
             DEVICE1_NAME, new MeasurementSchema("s1", TSDataType.INT32, 
TSEncoding.RLE));
     ReadOnlyMemChunk memChunk =
-        recoveryMemTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, 
null, null);
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     IPointReader iterator = memChunk.getPointReader();
     int time = 5;
     while (iterator.hasNextTimeValuePair()) {
@@ -356,7 +357,8 @@ public class TsFilePlanRedoerTest {
     fullPath =
         new NonAlignedFullPath(
             DEVICE1_NAME, new MeasurementSchema("s2", TSDataType.INT64, 
TSEncoding.RLE));
-    memChunk = recoveryMemTable.query(new QueryContext(), fullPath, 
Long.MIN_VALUE, null, null);
+    memChunk =
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     iterator = memChunk.getPointReader();
     time = 5;
     while (iterator.hasNextTimeValuePair()) {
@@ -455,7 +457,7 @@ public class TsFilePlanRedoerTest {
                 new MeasurementSchema("s4", TSDataType.FLOAT, TSEncoding.RLE),
                 new MeasurementSchema("s5", TSDataType.TEXT, 
TSEncoding.PLAIN)));
     ReadOnlyMemChunk memChunk =
-        recoveryMemTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, 
null, null);
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     IPointReader iterator = memChunk.getPointReader();
     int time = 6;
     while (iterator.hasNextTimeValuePair()) {
@@ -577,13 +579,14 @@ public class TsFilePlanRedoerTest {
         new NonAlignedFullPath(
             DEVICE1_NAME, new MeasurementSchema("s1", TSDataType.INT32, 
TSEncoding.RLE));
     ReadOnlyMemChunk memChunk =
-        recoveryMemTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, 
null, null);
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     assertTrue(memChunk == null || memChunk.isEmpty());
     // check d1.s2
     fullPath =
         new NonAlignedFullPath(
             DEVICE1_NAME, new MeasurementSchema("s2", TSDataType.INT64, 
TSEncoding.RLE));
-    memChunk = recoveryMemTable.query(new QueryContext(), fullPath, 
Long.MIN_VALUE, null, null);
+    memChunk =
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     assertTrue(memChunk == null || memChunk.isEmpty());
   }
 
@@ -788,7 +791,7 @@ public class TsFilePlanRedoerTest {
                 new MeasurementSchema("s4", TSDataType.FLOAT, TSEncoding.RLE),
                 new MeasurementSchema("s5", TSDataType.TEXT, 
TSEncoding.PLAIN)));
     ReadOnlyMemChunk memChunk =
-        recoveryMemTable.query(new QueryContext(), fullPath, Long.MIN_VALUE, 
null, null);
+        recoveryMemTable.query(new QueryContext(false), fullPath, 
Long.MIN_VALUE, null, null);
     IPointReader iterator = memChunk.getPointReader();
     time = 6;
     while (iterator.hasNextTimeValuePair()) {
diff --git 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
index ebd4d3b7ae0..91149d027fb 100644
--- 
a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
+++ 
b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/EnvironmentUtils.java
@@ -84,7 +84,7 @@ public class EnvironmentUtils {
   private static final TierManager tierManager = TierManager.getInstance();
 
   public static long TEST_QUERY_JOB_ID = 1;
-  public static QueryContext TEST_QUERY_CONTEXT = new 
QueryContext(TEST_QUERY_JOB_ID);
+  public static QueryContext TEST_QUERY_CONTEXT = new 
QueryContext(TEST_QUERY_JOB_ID, false);
   public static FragmentInstanceContext TEST_QUERY_FI_CONTEXT =
       
FragmentInstanceContext.createFragmentInstanceContextForCompaction(TEST_QUERY_JOB_ID);
 
@@ -278,7 +278,7 @@ public class EnvironmentUtils {
     }
 
     TEST_QUERY_JOB_ID = QueryResourceManager.getInstance().assignQueryId();
-    TEST_QUERY_CONTEXT = new QueryContext(TEST_QUERY_JOB_ID);
+    TEST_QUERY_CONTEXT = new QueryContext(TEST_QUERY_JOB_ID, false);
   }
 
   private static void createAllDir() {
diff --git 
a/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
 
b/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
index 2982e506ea9..08a8b4c2e82 100644
--- 
a/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
+++ 
b/iotdb-core/relational-grammar/src/main/antlr4/org/apache/iotdb/db/relational/grammar/sql/RelationalSql.g4
@@ -1454,7 +1454,7 @@ nonReserved
     : ABSENT | ADD | ADMIN | AFTER | ALL | ANALYZE | ANY | ARRAY | ASC | AT | 
ATTRIBUTE | AUDIT | AUTHORIZATION | AVAILABLE
     | BEGIN | BERNOULLI | BOTH
     | CACHE | CALL | CALLED | CASCADE | CATALOG | CATALOGS | CHAR | CHARACTER 
| CHARSET | CLEAR | CLUSTER | CLUSTERID | COLUMN | COLUMNS | COMMENT | COMMIT | 
COMMITTED | CONDITION | CONDITIONAL | CONFIGNODES | CONFIGNODE | CONFIGURATION 
| CONNECTOR | CONSTANT | COPARTITION | COUNT | CURRENT
-    | DATA | DATABASE | DATABASES | DATANODE | DATANODES | DATASET | DATE | 
DAY | DECLARE | DEFAULT | DEFINE | DEFINER | DENY | DESC | DESCRIPTOR | 
DETAILS| DETERMINISTIC | DEVICES | DISTRIBUTED | DO | DOUBLE
+    | DATA | DATABASE | DATABASES | DATANODE | DATANODES | DATASET | DATE | 
DAY | DEBUG | DECLARE | DEFAULT | DEFINE | DEFINER | DENY | DESC | DESCRIPTOR | 
DETAILS| DETERMINISTIC | DEVICES | DISTRIBUTED | DO | DOUBLE
     | ELSEIF | EMPTY | ENCODING | ERROR | EXCLUDING | EXPLAIN | EXTRACTOR
     | FETCH | FIELD | FILTER | FINAL | FIRST | FLUSH | FOLLOWING | FORCEDLY | 
FORMAT | FUNCTION | FUNCTIONS
     | GRACE | GRANT | GRANTED | GRANTS | GRAPHVIZ | GROUPS
@@ -1561,6 +1561,7 @@ DATE_BIN: 'DATE_BIN';
 DATE_BIN_GAPFILL: 'DATE_BIN_GAPFILL';
 DAY: 'DAY' | 'D';
 DEALLOCATE: 'DEALLOCATE';
+DEBUG: 'DEBUG';
 DECLARE: 'DECLARE';
 DEFAULT: 'DEFAULT';
 DEFINE: 'DEFINE';


Reply via email to