Hi everyone,

I am Shaurya Vardhan Singh Chauhan, a B.Tech Computer Science student and
an aspiring contributor to Apache IoTDB. I am writing to propose and
discuss the implementation of the *DESCRIBE QUERY* statement for the IoTDB
Table Model.

*Goal:* The goal is to allow users to extract relational metadata (column
names and data types) from a given query without actually executing the
full query. This is particularly useful for client-side applications and BI
tools that need to understand the schema of a result set beforehand.

*Proposed Implementation:* I have already initiated a Draft Pull Request (
*#17270*) to start the framework. Based on initial feedback from Yuan Tian
(@JackieTien97), the planned approach is:

   1.

   *Grammar & AST:* Added DESCRIBE QUERY syntax and corresponding AST nodes.
   2.

   *Analysis:* Using StatementAnalyzer to perform semantic analysis and
   extract output symbols.
   3.

   *Execution:* Instead of creating a new physical operator, I will use
   TableModelStatementMemorySourceVisitor to return the metadata as a
   result set.
   4.

   *Optimization:* Handling the logic in QueryExecution to ensure the
   actual query execution is skipped when isDescribe is true, returning
   only the analyzed schema.

*Current Progress:* The local build is successful, and the analyzer is
currently able to log the metadata. I am now working on integrating the
MemorySource logic as suggested by the mentors.

I would highly appreciate any feedback, suggestions, or concerns the
community might have regarding this approach.

*Draft PR Link:* https://github.com/apache/iotdb/pull/17270

Regards, Shaurya Vardhan Singh Chauhan

Reply via email to