Repository navigation
Conversation
This also stops rewriting `SESSION` away. Closes apache#1694
| Self::Local => write!(f, " LOCAL"), | ||
| Self::Session => write!(f, " SESSION"), | ||
| Self::Global => write!(f, " GLOBAL"), | ||
| Self::None => write!(f, ""), |
There was a problem hiding this comment.
does it work the same to define scope as an optional field (scope: Option<SetVariableScope>)? in order to represent None by convention?
| pub fn parse_set(&mut self) -> Result<Statement, ParserError> { | ||
| let modifier = | ||
| self.parse_one_of_keywords(&[Keyword::SESSION, Keyword::LOCAL, Keyword::HIVEVAR]); | ||
| let modifier_keywords = if self.dialect.supports_global_variable_modifier() { |
There was a problem hiding this comment.
I'm thinking having the lone global keyword as a dialect flag might not scale API wise, to make it dialect specific maybe it might make sense to have delegate to the dialect? like with parse_column_option as an example except with a default implementation that others like hive and mysql can override.
e.g.
let scope = self.dialect.parse_set_variable_scope(self)?;|
I actually think between the point about API scalability and the further/future need for substantially different parsing for MySQL (#1697), this particular approach that just shoehorns in |
This also stops rewriting
SESSIONaway.Closes #1694