File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5216,6 +5216,19 @@ pub enum Statement {
52165216 object_name : ObjectName ,
52175217 } ,
52185218 /// ```sql
5219+ /// DESC | DESCRIBE RESULT <query_id>
5220+ /// ```
5221+ /// Snowflake-style `DESCRIBE RESULT '<query_id>'`, returning the column
5222+ /// metadata of a previously executed query's result set. The argument is a
5223+ /// general expression covering a string literal (`'01b...'`) and a function
5224+ /// call (`LAST_QUERY_ID()`).
5225+ DescribeResult {
5226+ /// `DESC` or `DESCRIBE`
5227+ describe_alias : DescribeAlias ,
5228+ /// The query-id argument.
5229+ query_id : Box < Expr > ,
5230+ } ,
5231+ /// ```sql
52195232 /// [EXPLAIN | DESC | DESCRIBE] <statement>
52205233 /// ```
52215234 Explain {
@@ -5754,6 +5767,12 @@ impl fmt::Display for Statement {
57545767 } => {
57555768 write ! ( f, "{describe_alias} {object_type} {object_name}" )
57565769 }
5770+ Statement :: DescribeResult {
5771+ describe_alias,
5772+ query_id,
5773+ } => {
5774+ write ! ( f, "{describe_alias} RESULT {query_id}" )
5775+ }
57575776 Statement :: Explain {
57585777 describe_alias,
57595778 verbose,
Original file line number Diff line number Diff line change @@ -476,6 +476,7 @@ impl Spanned for Statement {
476476 Statement :: Kill { .. } => Span :: empty ( ) ,
477477 Statement :: ExplainTable { .. } => Span :: empty ( ) ,
478478 Statement :: DescribeObject { .. } => Span :: empty ( ) ,
479+ Statement :: DescribeResult { .. } => Span :: empty ( ) ,
479480 Statement :: Explain { .. } => Span :: empty ( ) ,
480481 Statement :: Savepoint { .. } => Span :: empty ( ) ,
481482 Statement :: ReleaseSavepoint { .. } => Span :: empty ( ) ,
Original file line number Diff line number Diff line change @@ -14549,6 +14549,13 @@ impl<'a> Parser<'a> {
1454914549 DescribeAlias::Desc | DescribeAlias::Describe
1455014550 )
1455114551 {
14552+ if self.parse_keyword(Keyword::RESULT) {
14553+ let query_id = self.parse_expr()?;
14554+ return Ok(Statement::DescribeResult {
14555+ describe_alias,
14556+ query_id: Box::new(query_id),
14557+ });
14558+ }
1455214559 if let Some(kw) = self.parse_one_of_keywords(&[
1455314560 Keyword::TABLE,
1455414561 Keyword::VIEW,
You can’t perform that action at this time.
0 commit comments