MCPcopy Create free account
hub / github.com/apache/datafusion / parse_option_value

Method parse_option_value

datafusion/sql/src/parser.rs:747–758  ·  view source on GitHub ↗

Parse the next token as a value for an option list Note this is different than [`parse_value`] as it allows any word or keyword in this location. [`parse_value`]: sqlparser::parser::Parser::parse_value

(&mut self)

Source from the content-addressed store, hash-verified

745 ///
746 /// [`parse_value`]: sqlparser::parser::Parser::parse_value
747 pub fn parse_option_value(&mut self) -> Result<Value, DataFusionError> {
748 let next_token = self.parser.next_token();
749 match next_token.token {
750 // e.g. things like "snappy" or "gzip" that may be keywords
751 Token::Word(word) => Ok(Value::SingleQuotedString(word.value)),
752 Token::SingleQuotedString(s) => Ok(Value::SingleQuotedString(s)),
753 Token::DoubleQuotedString(s) => Ok(Value::DoubleQuotedString(s)),
754 Token::EscapedStringLiteral(s) => Ok(Value::EscapedStringLiteral(s)),
755 Token::Number(n, l) => Ok(Value::Number(n, l)),
756 _ => self.expected("string or numeric value", &next_token),
757 }
758 }
759
760 /// Parse a SQL `EXPLAIN`
761 pub fn parse_explain(&mut self) -> Result<Statement, DataFusionError> {

Callers 2

parse_value_optionsMethod · 0.80
parse_value_optionsMethod · 0.80

Calls 1

expectedMethod · 0.80

Tested by

no test coverage detected