alamb commented on code in PR #1718:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1718#discussion_r1960483115


##########
src/ast/mod.rs:
##########
@@ -3058,6 +3058,33 @@ pub enum Statement {
         begin: bool,
         transaction: Option<BeginTransactionKind>,
         modifier: Option<TransactionModifier>,
+        /// List of statements belonging to the `BEGIN` block.
+        /// Example:
+        /// ```sql
+        /// BEGIN
+        ///     SELECT 1;
+        ///     SELECT 2;
+        /// END;
+        /// ```
+        statements: Vec<Statement>,
+        /// TRUE if the statement has a
+        /// `EXCEPTION WHEN ERROR THEN` clause
+        /// Example:
+        /// ```sql
+        /// BEGIN
+        ///     SELECT 1;
+        ///     SELECT 2;
+        /// EXCEPTION WHEN ERROR THEN
+        ///     SELECT 3;
+        /// END;
+        /// ```
+        /// 
<https://cloud.google.com/bigquery/docs/reference/standard-sql/procedural-language#beginexceptionend>
+        has_exception_when_clause: bool,

Review Comment:
   I wondered if this field redundant with when `exception_statements` is 
empty? However, given the test cases below, it seems it is possible to have a 
`EXCEPTION WHEN ERROR THEN END`  (without any statements) so distinguishing is 
necessary
   
   BTW another more Rusty way might be to represent this as 
   ```rust
           exception_statements: Option<Vec<Statement>>,
   ```
   
   I don't feel strongly about this however



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