use crate::{Expr, LogicalPlan};
use datafusion_common::DFSchemaRef;
use std::{any::Any, collections::HashSet, fmt, sync::Arc};
pub trait UserDefinedLogicalNode: fmt::Debug + Send + Sync {
fn as_any(&self) -> &dyn Any;
fn inputs(&self) -> Vec<&LogicalPlan>;
fn schema(&self) -> &DFSchemaRef;
fn expressions(&self) -> Vec<Expr>;
fn prevent_predicate_push_down_columns(&self) -> HashSet<String> {
self.schema()
.fields()
.iter()
.map(|f| f.name().clone())
.collect()
}
fn fmt_for_explain(&self, f: &mut fmt::Formatter) -> fmt::Result;
#[allow(clippy::wrong_self_convention)]
fn from_template(
&self,
exprs: &[Expr],
inputs: &[LogicalPlan],
) -> Arc<dyn UserDefinedLogicalNode>;
}