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

Function create_projection_exprs

datafusion/datasource/src/projection.rs:299–312  ·  view source on GitHub ↗
(
        exprs: impl IntoIterator<Item = &'a Expr>,
        schema: &SchemaRef,
    )

Source from the content-addressed store, hash-verified

297 use super::*;
298
299 fn create_projection_exprs<'a>(
300 exprs: impl IntoIterator<Item = &'a Expr>,
301 schema: &SchemaRef,
302 ) -> ProjectionExprs {
303 let df_schema = DFSchema::try_from(Arc::clone(schema)).unwrap();
304 let physical_exprs =
305 create_physical_exprs(exprs, &df_schema, &ExecutionProps::default()).unwrap();
306 let projection_exprs = physical_exprs
307 .into_iter()
308 .enumerate()
309 .map(|(i, e)| ProjectionExpr::new(Arc::clone(&e), format!("col{i}")))
310 .collect_vec();
311 ProjectionExprs::from(projection_exprs)
312 }
313
314 #[test]
315 fn test_split_projection_with_partition_columns() {

Calls 4

create_physical_exprsFunction · 0.85
newFunction · 0.85
mapMethod · 0.45
into_iterMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…