pub enum SelectExpr {
Wildcard(WildcardOptions),
QualifiedWildcard(TableReference, WildcardOptions),
Expression(Expr),
}Expand description
Represents a SELECT expression in a SQL query.
SelectExpr supports three types of expressions commonly found in the SELECT clause:
- Wildcard (
*) - Selects all columns - Qualified wildcard (
table.*) - Selects all columns from a specific table - Regular expression - Any other expression like columns, functions, literals etc.
This enum is typically used when you need to handle wildcards. After expanding * in the query,
you can use Expr for all other expressions.
§Examples
use datafusion_expr::col;
use datafusion_expr::expr::WildcardOptions;
use datafusion_expr::select_expr::SelectExpr;
// SELECT *
let wildcard = SelectExpr::Wildcard(WildcardOptions::default());
// SELECT mytable.*
let qualified = SelectExpr::QualifiedWildcard(
"mytable".into(),
WildcardOptions::default()
);
// SELECT col1
let expr = SelectExpr::Expression(col("col1").into());Variants§
Wildcard(WildcardOptions)
Represents a wildcard (*) that selects all columns from all tables.
The WildcardOptions control additional behavior like exclusions.
QualifiedWildcard(TableReference, WildcardOptions)
Represents a qualified wildcard (table.*) that selects all columns from a specific table.
The TableReference specifies the table and WildcardOptions control additional behavior.
Expression(Expr)
Represents any other valid SELECT expression like column references, function calls, literals, etc.
Trait Implementations§
Source§impl Clone for SelectExpr
impl Clone for SelectExpr
Source§fn clone(&self) -> SelectExpr
fn clone(&self) -> SelectExpr
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SelectExpr
impl Debug for SelectExpr
Source§impl Display for SelectExpr
impl Display for SelectExpr
Source§impl<'a> From<(Option<&'a TableReference>, &'a Arc<Field>)> for SelectExpr
Create an SelectExpr::Expression from an optional qualifier and a FieldRef. This is
useful for creating SelectExpr::Expression from a DFSchema.
impl<'a> From<(Option<&'a TableReference>, &'a Arc<Field>)> for SelectExpr
Create an SelectExpr::Expression from an optional qualifier and a FieldRef. This is
useful for creating SelectExpr::Expression from a DFSchema.
See example on Expr
Source§impl From<Column> for SelectExpr
Create an SelectExpr::Expression from a Column
impl From<Column> for SelectExpr
Create an SelectExpr::Expression from a Column
Auto Trait Implementations§
impl Freeze for SelectExpr
impl !RefUnwindSafe for SelectExpr
impl Send for SelectExpr
impl Sync for SelectExpr
impl Unpin for SelectExpr
impl !UnwindSafe for SelectExpr
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more