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

Method process_query

benchmarks/src/sql_benchmark.rs:526–555  ·  view source on GitHub ↗
(&mut self, splits: &[&str], mut query: String)

Source from the content-addressed store, hash-verified

524 }
525
526 fn process_query(&mut self, splits: &[&str], mut query: String) -> Result<()> {
527 debug!("Processing query {query}");
528
529 // Trim and validate.
530 query = query.trim().to_string();
531 if query.is_empty() {
532 return Ok(());
533 }
534
535 // remove comments
536 query = query
537 .lines()
538 .filter(|line| !is_comment_line(line))
539 .collect::<Vec<_>>()
540 .join("\n");
541
542 if query.trim().is_empty() {
543 return Ok(());
544 }
545
546 query = process_replacements(&query, self.replacement_mapping())?;
547
548 let directive = QueryDirective::parse(splits[0]).ok_or_else(|| {
549 exec_datafusion_err!("Invalid query directive: {}", splits[0])
550 })?;
551
552 self.queries.entry(directive).or_default().push(query);
553
554 Ok(())
555 }
556
557 fn validate_expected_plan(&self, physical_plan: &impl Debug) -> Result<()> {
558 if self.expect.is_empty() {

Callers 1

Calls 9

is_comment_lineFunction · 0.85
process_replacementsFunction · 0.85
trimMethod · 0.80
replacement_mappingMethod · 0.80
to_stringMethod · 0.45
is_emptyMethod · 0.45
joinMethod · 0.45
filterMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected