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

Method prepare_select_exprs

datafusion/sql/src/select.rs:787–804  ·  view source on GitHub ↗

Returns the `Expr`'s corresponding to a SQL query's SELECT expressions.

(
        &self,
        plan: &LogicalPlan,
        projection: Vec<SelectItem>,
        empty_from: bool,
        planner_context: &mut PlannerContext,
    )

Source from the content-addressed store, hash-verified

785
786 /// Returns the `Expr`'s corresponding to a SQL query's SELECT expressions.
787 pub(crate) fn prepare_select_exprs(
788 &self,
789 plan: &LogicalPlan,
790 projection: Vec<SelectItem>,
791 empty_from: bool,
792 planner_context: &mut PlannerContext,
793 ) -> Result<Vec<SelectExpr>> {
794 let mut prepared_select_exprs = vec![];
795 let mut error_builder = DataFusionErrorBuilder::new();
796
797 for expr in projection {
798 match self.sql_select_to_rex(expr, plan, empty_from, planner_context) {
799 Ok(expr) => prepared_select_exprs.push(expr),
800 Err(err) => error_builder.add_error(err),
801 }
802 }
803 error_builder.error_or(prepared_select_exprs)
804 }
805
806 /// Generate a relational expression from a select SQL expression
807 fn sql_select_to_rex(

Callers 2

select_to_planMethod · 0.80
pipe_operatorMethod · 0.80

Calls 5

newFunction · 0.85
sql_select_to_rexMethod · 0.80
add_errorMethod · 0.80
error_orMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected