iffyio commented on code in PR #2072:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2072#discussion_r2447136912


##########
src/parser/mod.rs:
##########
@@ -9766,6 +9676,21 @@ impl<'a> Parser<'a> {
             Some(Keyword::BLANKSASNULL) => CopyLegacyOption::BlankAsNull,
             Some(Keyword::BZIP2) => CopyLegacyOption::Bzip2,
             Some(Keyword::CLEANPATH) => CopyLegacyOption::CleanPath,
+            Some(Keyword::COMPUPDATE) => {
+                let preset = self.parse_keyword(Keyword::PRESET);
+                let enabled = match self.parse_one_of_keywords(&[
+                    Keyword::TRUE,
+                    Keyword::FALSE,
+                    Keyword::ON,
+                    Keyword::OFF,
+                ]) {
+                    Some(Keyword::PRESET) => None,

Review Comment:
   is this branch valid, we don't seem to expect it in the keywords?



##########
src/ast/mod.rs:
##########
@@ -8278,6 +8710,22 @@ impl fmt::Display for CopyLegacyOption {
             BlankAsNull => write!(f, "BLANKSASNULL"),
             Bzip2 => write!(f, "BZIP2"),
             CleanPath => write!(f, "CLEANPATH"),
+            CompUpdate { preset, enabled } => {
+                write!(f, "COMPUPDATE")?;
+                if *preset {
+                    write!(f, " PRESET")
+                } else {
+                    write!(
+                        f,
+                        "{}",
+                        match *enabled {
+                            Some(true) => " TRUE",
+                            Some(false) => " FALSE",
+                            _ => "",
+                        }
+                    )

Review Comment:
   this looks like it can be simplified as?
   ```rust
   if let Some(enabled) = enabled {
       write!()
   }
   ```



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