mvzink commented on code in PR #1767: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1767#discussion_r2001988225
########## 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: Would `fn context_modifier_from_keyword(kw: Option<Keyword>) -> Result<ContextModifier>` be fine to account for that? -- 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