JackieTien97 commented on code in PR #17270:
URL: https://github.com/apache/iotdb/pull/17270#discussion_r2928334169


##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/QueryExecution.java:
##########
@@ -252,7 +252,7 @@ private ExecutionResult retry() {
   }
 
   private boolean skipExecute() {
-    return analysis.canSkipExecute(context);
+    return analysis.isFailed() || analysis.isFinishQueryAfterAnalyze();

Review Comment:
   why do this change?



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/memory/TableModelStatementMemorySourceVisitor.java:
##########
@@ -130,6 +130,61 @@ public StatementMemorySource visitCountDevice(
         node.getTsBlock(context.getAnalysis()), node.getDataSetHeader());
   }
 
+  @Override
+  public StatementMemorySource visitDescribeQuery(
+      org.apache.iotdb.db.queryengine.plan.relational.sql.ast.DescribeQuery 
node,
+      TableModelStatementMemorySourceContext context) {
+
+    java.util.List<org.apache.iotdb.commons.schema.column.ColumnHeader> 
columnHeaders =
+        new java.util.ArrayList<>();
+    columnHeaders.add(
+        new org.apache.iotdb.commons.schema.column.ColumnHeader(
+            "Column", org.apache.tsfile.enums.TSDataType.TEXT));
+    columnHeaders.add(
+        new org.apache.iotdb.commons.schema.column.ColumnHeader(
+            "Type", org.apache.tsfile.enums.TSDataType.TEXT));

Review Comment:
   you should read more about duckdb's definition, `column_name` and 
`column_type` should be the column headers. And their type should be `STRING`.
   
   And these constants should be defined in `ColumnHeaderConstant` class



##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/transformation/datastructure/tv/ElasticSerializableTVList.java:
##########


Review Comment:
   changes to this class is unrelated to this feature, don't include them.



##########
iotdb-core/antlr/src/main/antlr4/org/apache/iotdb/db/qp/sql/IoTDBSqlParser.g4:
##########
@@ -1239,6 +1240,11 @@ explain
     : EXPLAIN (ANALYZE VERBOSE?)? selectStatement?
     ;
 
+// ---- Describe
+describe
+    : DESCRIBE selectStatement
+    ;
+

Review Comment:
   we only need to support it in table model, this g4 file is for tree model



-- 
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