pub struct DFParser<'a> {
pub parser: Parser<'a>,
/* private fields */
}Expand description
DataFusion SQL Parser based on sqlparser
Parses DataFusion’s SQL dialect, often delegating to sqlparser’s Parser.
DataFusion mostly follows existing SQL dialects via
sqlparser. However, certain statements such as COPY and
CREATE EXTERNAL TABLE have special syntax in DataFusion. See
Statement for a list of this special syntax
Fields§
§parser: Parser<'a>Implementations§
Source§impl<'a> DFParser<'a>
impl<'a> DFParser<'a>
pub fn new(sql: &'a str) -> Result<DFParser<'a>, DataFusionError>
pub fn new_with_dialect( sql: &'a str, dialect: &'a (dyn Dialect + 'static), ) -> Result<DFParser<'a>, DataFusionError>
Sourcepub fn parse_sql(sql: &'a str) -> Result<VecDeque<Statement>, DataFusionError>
pub fn parse_sql(sql: &'a str) -> Result<VecDeque<Statement>, DataFusionError>
Parse a sql string into one or Statements using the
GenericDialect.
Sourcepub fn parse_sql_with_dialect(
sql: &str,
dialect: &(dyn Dialect + 'static),
) -> Result<VecDeque<Statement>, DataFusionError>
pub fn parse_sql_with_dialect( sql: &str, dialect: &(dyn Dialect + 'static), ) -> Result<VecDeque<Statement>, DataFusionError>
Parse a SQL string and produce one or more Statements with
with the specified dialect.
pub fn parse_sql_into_expr(sql: &str) -> Result<ExprWithAlias, DataFusionError>
pub fn parse_sql_into_expr_with_dialect( sql: &str, dialect: &(dyn Dialect + 'static), ) -> Result<ExprWithAlias, DataFusionError>
Sourcepub fn parse_statements(
&mut self,
) -> Result<VecDeque<Statement>, DataFusionError>
pub fn parse_statements( &mut self, ) -> Result<VecDeque<Statement>, DataFusionError>
Parse a sql string into one or Statements
Sourcepub fn parse_statement(&mut self) -> Result<Statement, DataFusionError>
pub fn parse_statement(&mut self) -> Result<Statement, DataFusionError>
Parse a new expression
pub fn parse_expr(&mut self) -> Result<ExprWithAlias, DataFusionError>
Sourcepub fn parse_into_expr(&mut self) -> Result<ExprWithAlias, DataFusionError>
pub fn parse_into_expr(&mut self) -> Result<ExprWithAlias, DataFusionError>
Parses the entire SQL string into an expression.
In contrast to DFParser::parse_expr, this function will report an error if the input
contains any trailing, unparsed tokens.
Sourcepub fn parse_copy(&mut self) -> Result<Statement, DataFusionError>
pub fn parse_copy(&mut self) -> Result<Statement, DataFusionError>
Parse a SQL COPY TO statement
Sourcepub fn parse_option_key(&mut self) -> Result<String, DataFusionError>
pub fn parse_option_key(&mut self) -> Result<String, DataFusionError>
Parse the next token as a key name for an option list
Note this is different than parse_literal_string
because it allows keywords as well as other non words
Sourcepub fn parse_option_value(&mut self) -> Result<Value, DataFusionError>
pub fn parse_option_value(&mut self) -> Result<Value, DataFusionError>
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.
Sourcepub fn parse_explain(&mut self) -> Result<Statement, DataFusionError>
pub fn parse_explain(&mut self) -> Result<Statement, DataFusionError>
Parse a SQL EXPLAIN
pub fn parse_explain_format( &mut self, ) -> Result<Option<String>, DataFusionError>
Sourcepub fn parse_create(&mut self) -> Result<Statement, DataFusionError>
pub fn parse_create(&mut self) -> Result<Statement, DataFusionError>
Parse a SQL CREATE statement handling CREATE EXTERNAL TABLE
Sourcepub fn parse_order_by_exprs(
&mut self,
) -> Result<Vec<OrderByExpr>, DataFusionError>
pub fn parse_order_by_exprs( &mut self, ) -> Result<Vec<OrderByExpr>, DataFusionError>
Parse the ordering clause of a CREATE EXTERNAL TABLE SQL statement
Sourcepub fn parse_order_by_expr(&mut self) -> Result<OrderByExpr, DataFusionError>
pub fn parse_order_by_expr(&mut self) -> Result<OrderByExpr, DataFusionError>
Parse an ORDER BY sub-expression optionally followed by ASC or DESC.
Auto Trait Implementations§
impl<'a> Freeze for DFParser<'a>
impl<'a> !RefUnwindSafe for DFParser<'a>
impl<'a> !Send for DFParser<'a>
impl<'a> !Sync for DFParser<'a>
impl<'a> Unpin for DFParser<'a>
impl<'a> !UnwindSafe for DFParser<'a>
Blanket Implementations§
Source§impl<T> AlignerFor<1> for T
impl<T> AlignerFor<1> for T
Source§impl<T> AlignerFor<1024> for T
impl<T> AlignerFor<1024> for T
Source§type Aligner = AlignTo1024<T>
type Aligner = AlignTo1024<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<128> for T
impl<T> AlignerFor<128> for T
Source§type Aligner = AlignTo128<T>
type Aligner = AlignTo128<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<16> for T
impl<T> AlignerFor<16> for T
Source§impl<T> AlignerFor<16384> for T
impl<T> AlignerFor<16384> for T
Source§type Aligner = AlignTo16384<T>
type Aligner = AlignTo16384<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<2> for T
impl<T> AlignerFor<2> for T
Source§impl<T> AlignerFor<2048> for T
impl<T> AlignerFor<2048> for T
Source§type Aligner = AlignTo2048<T>
type Aligner = AlignTo2048<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<256> for T
impl<T> AlignerFor<256> for T
Source§type Aligner = AlignTo256<T>
type Aligner = AlignTo256<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<32> for T
impl<T> AlignerFor<32> for T
Source§impl<T> AlignerFor<32768> for T
impl<T> AlignerFor<32768> for T
Source§type Aligner = AlignTo32768<T>
type Aligner = AlignTo32768<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<4> for T
impl<T> AlignerFor<4> for T
Source§impl<T> AlignerFor<4096> for T
impl<T> AlignerFor<4096> for T
Source§type Aligner = AlignTo4096<T>
type Aligner = AlignTo4096<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<512> for T
impl<T> AlignerFor<512> for T
Source§type Aligner = AlignTo512<T>
type Aligner = AlignTo512<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> AlignerFor<64> for T
impl<T> AlignerFor<64> for T
Source§impl<T> AlignerFor<8> for T
impl<T> AlignerFor<8> for T
Source§impl<T> AlignerFor<8192> for T
impl<T> AlignerFor<8192> for T
Source§type Aligner = AlignTo8192<T>
type Aligner = AlignTo8192<T>
AlignTo* type which aligns Self to ALIGNMENT.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<S> ROExtAcc for S
impl<S> ROExtAcc for S
Source§fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
fn f_get<F>(&self, offset: FieldOffset<S, F, Aligned>) -> &F
offset. Read moreSource§fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
fn f_get_mut<F>(&mut self, offset: FieldOffset<S, F, Aligned>) -> &mut F
offset. Read moreSource§fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
fn f_get_ptr<F, A>(&self, offset: FieldOffset<S, F, A>) -> *const F
offset. Read moreSource§fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
fn f_get_mut_ptr<F, A>(&mut self, offset: FieldOffset<S, F, A>) -> *mut F
offset. Read moreSource§impl<S> ROExtOps<Aligned> for S
impl<S> ROExtOps<Aligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Aligned>, value: F) -> F
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Aligned>) -> Fwhere
F: Copy,
Source§impl<S> ROExtOps<Unaligned> for S
impl<S> ROExtOps<Unaligned> for S
Source§fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
fn f_replace<F>(&mut self, offset: FieldOffset<S, F, Unaligned>, value: F) -> F
offset) with value,
returning the previous value of the field. Read moreSource§fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
fn f_get_copy<F>(&self, offset: FieldOffset<S, F, Unaligned>) -> Fwhere
F: Copy,
Source§impl<T> SelfOps for Twhere
T: ?Sized,
impl<T> SelfOps for Twhere
T: ?Sized,
Source§fn piped<F, U>(self, f: F) -> U
fn piped<F, U>(self, f: F) -> U
Source§fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
fn piped_ref<'a, F, U>(&'a self, f: F) -> Uwhere
F: FnOnce(&'a Self) -> U,
piped except that the function takes &Self
Useful for functions that take &Self instead of Self. Read moreSource§fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
fn piped_mut<'a, F, U>(&'a mut self, f: F) -> Uwhere
F: FnOnce(&'a mut Self) -> U,
piped, except that the function takes &mut Self.
Useful for functions that take &mut Self instead of Self.Source§fn mutated<F>(self, f: F) -> Self
fn mutated<F>(self, f: F) -> Self
Source§fn observe<F>(self, f: F) -> Self
fn observe<F>(self, f: F) -> Self
Source§fn as_ref_<T>(&self) -> &T
fn as_ref_<T>(&self) -> &T
AsRef,
using the turbofish .as_ref_::<_>() syntax. Read more