MohamedAbdeen21 commented on code in PR #1767:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/1767#discussion_r2000753514


##########
src/ast/mod.rs:
##########
@@ -7919,11 +7921,28 @@ impl fmt::Display for ContextModifier {
                 write!(f, "")
             }
             Self::Local => {
-                write!(f, " LOCAL")
+                write!(f, "LOCAL ")
             }
             Self::Session => {
-                write!(f, " SESSION")
+                write!(f, "SESSION ")
             }
+            Self::Global => {
+                write!(f, "GLOBAL ")
+            }
+        }
+    }
+}
+
+impl From<Option<Keyword>> for ContextModifier {
+    fn from(kw: Option<Keyword>) -> Self {
+        match kw {
+            Some(kw) => match kw {
+                Keyword::LOCAL => Self::Local,
+                Keyword::SESSION => Self::Session,
+                Keyword::GLOBAL => Self::Global,
+                _ => Self::None,
+            },
+            None => Self::None,
         }
     }

Review Comment:
   I'm not following. Instead of an `impl From<Option<Keyword>> for 
ContextModifier` you'd prefer a `fn into_modifier(k: Option<Keyword>) -> 
ContextModifier`?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to