pravic commented on code in PR #2024:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2024#discussion_r2336560733


##########
src/parser/mod.rs:
##########
@@ -12260,6 +12260,27 @@ impl<'a> Parser<'a> {
         })
     }
 
+    /// Parse a CTE or CSE.
+    pub fn parse_cte_or_cse(&mut self) -> Result<CteOrCse, ParserError> {
+        Ok(if dialect_of!(self is ClickHouseDialect) {
+            if let Some(cse) = self.maybe_parse(Parser::parse_cse)? {
+                CteOrCse::Cse(cse)
+            } else {
+                CteOrCse::Cte(self.parse_cte()?)
+            }
+        } else {
+            CteOrCse::Cte(self.parse_cte()?)
+        })
+    }
+
+    /// Parse a CSE (`<expr> AS <ident>`).
+    pub fn parse_cse(&mut self) -> Result<Cse, ParserError> {
+        let expr = self.parse_expr()?;
+        let _after_as = self.parse_keyword(Keyword::AS);
+        let ident = self.parse_identifier()?;

Review Comment:
   Done in f2ada38f6e and tests in a8cca3bc18.
   



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to