MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / parse_explain_timestamp

Method parse_explain_timestamp

src/sql-parser/src/parser.rs:9248–9268  ·  view source on GitHub ↗

Parse an `EXPLAIN TIMESTAMP` statement, assuming that the `EXPLAIN TIMESTAMP` tokens have already been consumed.

(&mut self)

Source from the content-addressed store, hash-verified

9246 /// Parse an `EXPLAIN TIMESTAMP` statement, assuming that the `EXPLAIN
9247 /// TIMESTAMP` tokens have already been consumed.
9248 fn parse_explain_timestamp(&mut self) -> Result<Statement<Raw>, ParserError> {
9249 let format = if self.parse_keyword(AS) {
9250 match self.parse_one_of_keywords(&[TEXT, JSON, DOT]) {
9251 Some(TEXT) => Some(ExplainFormat::Text),
9252 Some(JSON) => Some(ExplainFormat::Json),
9253 None => return Err(ParserError::new(self.index, "expected a format")),
9254 _ => unreachable!(),
9255 }
9256 } else {
9257 None
9258 };
9259
9260 self.expect_keyword(FOR)?;
9261
9262 let query = self.parse_select_statement()?;
9263
9264 Ok(Statement::ExplainTimestamp(ExplainTimestampStatement {
9265 format,
9266 select: query,
9267 }))
9268 }
9269 /// Parse an `EXPLAIN [KEY|VALUE] SCHEMA` statement assuming that the `EXPLAIN` token
9270 /// have already been consumed
9271 fn parse_explain_schema(&mut self) -> Result<Statement<Raw>, ParserError> {

Callers 1

parse_explainMethod · 0.80

Calls 4

parse_keywordMethod · 0.80
parse_one_of_keywordsMethod · 0.80
expect_keywordMethod · 0.80

Tested by

no test coverage detected