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

Method build

datafusion/sql/src/parser.rs:420–441  ·  view source on GitHub ↗

Build resulting parser

(self)

Source from the content-addressed store, hash-verified

418
419 /// Build resulting parser
420 pub fn build(self) -> Result<DFParser<'b>, DataFusionError> {
421 let tokens = match self.input {
422 ParserInput::Tokens(tokens) => tokens,
423 ParserInput::Sql(sql) => {
424 let mut tokenizer = Tokenizer::new(self.dialect, sql);
425 // Convert TokenizerError -> ParserError
426 tokenizer
427 .tokenize_with_location()
428 .map_err(ParserError::from)?
429 }
430 };
431
432 Ok(DFParser {
433 parser: Parser::new(self.dialect)
434 .with_tokens_with_locations(tokens)
435 .with_recursion_limit(self.recursion_limit),
436 options: SqlParserOptions {
437 recursion_limit: self.recursion_limit,
438 ..Default::default()
439 },
440 })
441 }
442}
443
444impl<'a> DFParser<'a> {

Callers 15

select_to_planMethod · 0.45
try_process_unnestMethod · 0.45
plan_from_tablesMethod · 0.45
projectMethod · 0.45
aggregateMethod · 0.45
sql_values_to_planMethod · 0.45
newMethod · 0.45
new_with_dialectMethod · 0.45
parse_sqlMethod · 0.45

Calls 2

newFunction · 0.85
with_recursion_limitMethod · 0.80