liuminghui233 commented on code in PR #7146:
URL: https://github.com/apache/iotdb/pull/7146#discussion_r956933994


##########
server/src/main/java/org/apache/iotdb/db/mpp/plan/analyze/AnalyzeVisitor.java:
##########
@@ -177,6 +177,11 @@ public Analysis visitQuery(QueryStatement queryStatement, 
MPPQueryContext contex
       logger.info("{} fetch query schema...", getLogHeader());
       ISchemaTree schemaTree = schemaFetcher.fetchSchema(patternTree);
       logger.info("{} fetch schema done", getLogHeader());
+
+      if (queryStatement.isLastQuery()) {
+        
analysis.setRespDatasetHeader(DatasetHeaderFactory.getLastQueryHeader());
+      }
+
       // If there is no leaf node in the schema tree, the query should be 
completed immediately
       if (schemaTree.isEmpty()) {

Review Comment:
   ```suggestion
         if (schemaTree.isEmpty()) {
             if (queryStatement.isLastQuery()) {
               
analysis.setRespDatasetHeader(DatasetHeaderFactory.getLastQueryHeader());
             }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to