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

Method create_struct_expr

datafusion/sql/src/expr/mod.rs:853–865  ·  view source on GitHub ↗

Handles a call to struct(...) where the arguments are not named. For example `struct (v, v2)` by creating a call to the `struct` function which will create a struct with fields named `c0`, `c1`, etc.

(
        &self,
        values: Vec<SQLExpr>,
        input_schema: &DFSchema,
        planner_context: &mut PlannerContext,
    )

Source from the content-addressed store, hash-verified

851 // `struct (v, v2)` by creating a call to the `struct` function
852 // which will create a struct with fields named `c0`, `c1`, etc.
853 fn create_struct_expr(
854 &self,
855 values: Vec<SQLExpr>,
856 input_schema: &DFSchema,
857 planner_context: &mut PlannerContext,
858 ) -> Result<Vec<Expr>> {
859 values
860 .into_iter()
861 .map(|value| {
862 self.sql_expr_to_logical_expr(value, input_schema, planner_context)
863 })
864 .collect::<Result<Vec<_>>>()
865 }
866
867 fn sql_in_list_to_expr(
868 &self,

Callers 1

parse_structMethod · 0.80

Calls 3

mapMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected