pub struct TableArgReplace {
pub tables: Vec<(TableReference, TableFunctionArgs)>,
}Expand description
Used to construct a AstAnalyzer that can replace table arguments.
use datafusion::sql::sqlparser::ast::{FunctionArg, Expr, Value};
use datafusion::sql::TableReference;
use datafusion_federation::sql::ast_analyzer::TableArgReplace;
let mut analyzer = TableArgReplace::default().with(
TableReference::parse_str("table1"),
vec![FunctionArg::Unnamed(
Expr::value(
Value::Number("1".to_string(), false),
)
.into(),
)],
);
let analyzer = analyzer.into_analyzer();Fields§
§tables: Vec<(TableReference, TableFunctionArgs)>Implementations§
Source§impl TableArgReplace
impl TableArgReplace
Sourcepub fn new(tables: Vec<(TableReference, Vec<FunctionArg>)>) -> Self
pub fn new(tables: Vec<(TableReference, Vec<FunctionArg>)>) -> Self
Constructs a new TableArgReplace instance.
Sourcepub fn with(self, table: TableReference, args: Vec<FunctionArg>) -> Self
pub fn with(self, table: TableReference, args: Vec<FunctionArg>) -> Self
Adds a new table argument replacement.
Sourcepub fn into_analyzer(self) -> AstAnalyzer
pub fn into_analyzer(self) -> AstAnalyzer
Converts the TableArgReplace instance into an AstAnalyzer.
Trait Implementations§
Source§impl Clone for TableArgReplace
impl Clone for TableArgReplace
Source§fn clone(&self) -> TableArgReplace
fn clone(&self) -> TableArgReplace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableArgReplace
impl Debug for TableArgReplace
Source§impl Default for TableArgReplace
impl Default for TableArgReplace
Source§fn default() -> TableArgReplace
fn default() -> TableArgReplace
Returns the “default value” for a type. Read more
Source§impl PartialEq for TableArgReplace
impl PartialEq for TableArgReplace
Source§impl VisitorMut for TableArgReplace
impl VisitorMut for TableArgReplace
Source§fn pre_visit_table_factor(
&mut self,
table_factor: &mut TableFactor,
) -> ControlFlow<Self::Break>
fn pre_visit_table_factor( &mut self, table_factor: &mut TableFactor, ) -> ControlFlow<Self::Break>
Invoked for any table factors that appear in the AST before visiting children
Source§fn pre_visit_query(&mut self, _query: &mut Query) -> ControlFlow<Self::Break>
fn pre_visit_query(&mut self, _query: &mut Query) -> ControlFlow<Self::Break>
Invoked for any queries that appear in the AST before visiting children
Source§fn post_visit_query(&mut self, _query: &mut Query) -> ControlFlow<Self::Break>
fn post_visit_query(&mut self, _query: &mut Query) -> ControlFlow<Self::Break>
Invoked for any queries that appear in the AST after visiting children
Source§fn pre_visit_relation(
&mut self,
_relation: &mut ObjectName,
) -> ControlFlow<Self::Break>
fn pre_visit_relation( &mut self, _relation: &mut ObjectName, ) -> ControlFlow<Self::Break>
Invoked for any relations (e.g. tables) that appear in the AST before visiting children
Source§fn post_visit_relation(
&mut self,
_relation: &mut ObjectName,
) -> ControlFlow<Self::Break>
fn post_visit_relation( &mut self, _relation: &mut ObjectName, ) -> ControlFlow<Self::Break>
Invoked for any relations (e.g. tables) that appear in the AST after visiting children
Source§fn post_visit_table_factor(
&mut self,
_table_factor: &mut TableFactor,
) -> ControlFlow<Self::Break>
fn post_visit_table_factor( &mut self, _table_factor: &mut TableFactor, ) -> ControlFlow<Self::Break>
Invoked for any table factors that appear in the AST after visiting children
Source§fn pre_visit_expr(&mut self, _expr: &mut Expr) -> ControlFlow<Self::Break>
fn pre_visit_expr(&mut self, _expr: &mut Expr) -> ControlFlow<Self::Break>
Invoked for any expressions that appear in the AST before visiting children
Source§fn post_visit_expr(&mut self, _expr: &mut Expr) -> ControlFlow<Self::Break>
fn post_visit_expr(&mut self, _expr: &mut Expr) -> ControlFlow<Self::Break>
Invoked for any expressions that appear in the AST
Source§fn pre_visit_statement(
&mut self,
_statement: &mut Statement,
) -> ControlFlow<Self::Break>
fn pre_visit_statement( &mut self, _statement: &mut Statement, ) -> ControlFlow<Self::Break>
Invoked for any statements that appear in the AST before visiting children
Source§fn post_visit_statement(
&mut self,
_statement: &mut Statement,
) -> ControlFlow<Self::Break>
fn post_visit_statement( &mut self, _statement: &mut Statement, ) -> ControlFlow<Self::Break>
Invoked for any statements that appear in the AST after visiting children
Source§fn pre_visit_value(&mut self, _value: &mut Value) -> ControlFlow<Self::Break>
fn pre_visit_value(&mut self, _value: &mut Value) -> ControlFlow<Self::Break>
Invoked for any value that appear in the AST before visiting children
Source§fn post_visit_value(&mut self, _value: &mut Value) -> ControlFlow<Self::Break>
fn post_visit_value(&mut self, _value: &mut Value) -> ControlFlow<Self::Break>
Invoked for any statements that appear in the AST after visiting children
impl Eq for TableArgReplace
impl StructuralPartialEq for TableArgReplace
Auto Trait Implementations§
impl Freeze for TableArgReplace
impl RefUnwindSafe for TableArgReplace
impl Send for TableArgReplace
impl Sync for TableArgReplace
impl Unpin for TableArgReplace
impl UnwindSafe for TableArgReplace
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
Converts
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>
Converts
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