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

Method parse_sql_with_dialect

datafusion/sql/src/parser.rs:468–474  ·  view source on GitHub ↗

Parse a SQL string and produce one or more [`Statement`]s with with the specified dialect.

(
        sql: &str,
        dialect: &dyn Dialect,
    )

Source from the content-addressed store, hash-verified

466 /// Parse a SQL string and produce one or more [`Statement`]s with
467 /// with the specified dialect.
468 pub fn parse_sql_with_dialect(
469 sql: &str,
470 dialect: &dyn Dialect,
471 ) -> Result<VecDeque<Statement>, DataFusionError> {
472 let mut parser = DFParserBuilder::new(sql).with_dialect(dialect).build()?;
473 parser.parse_statements()
474 }
475
476 pub fn parse_sql_into_expr(sql: &str) -> Result<ExprWithAlias, DataFusionError> {
477 DFParserBuilder::new(sql).build()?.parse_into_expr()

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
with_dialectMethod · 0.80
parse_statementsMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected