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

Function test_create_cube_expr

datafusion/core/src/physical_planner.rs:3554–3682  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3552
3553 #[tokio::test]
3554 async fn test_create_cube_expr() -> Result<()> {
3555 let logical_plan = test_csv_scan().await?.build()?;
3556
3557 let plan = plan(&logical_plan).await?;
3558
3559 let exprs = vec![col("c1"), col("c2"), col("c3")];
3560
3561 let physical_input_schema = plan.schema();
3562 let physical_input_schema = physical_input_schema.as_ref();
3563 let logical_input_schema = logical_plan.schema();
3564 let session_state = make_session_state();
3565
3566 let cube = create_cube_physical_expr(
3567 &exprs,
3568 logical_input_schema,
3569 physical_input_schema,
3570 session_state.execution_props(),
3571 );
3572
3573 insta::assert_debug_snapshot!(cube, @r#"
3574 Ok(
3575 PhysicalGroupBy {
3576 expr: [
3577 (
3578 Column {
3579 name: "c1",
3580 index: 0,
3581 },
3582 "c1",
3583 ),
3584 (
3585 Column {
3586 name: "c2",
3587 index: 1,
3588 },
3589 "c2",
3590 ),
3591 (
3592 Column {
3593 name: "c3",
3594 index: 2,
3595 },
3596 "c3",
3597 ),
3598 ],
3599 null_expr: [
3600 (
3601 Literal {
3602 value: Utf8(NULL),
3603 field: Field {
3604 name: "lit",
3605 data_type: Utf8,
3606 nullable: true,
3607 },
3608 },
3609 "c1",
3610 ),
3611 (

Callers

nothing calls this directly

Calls 8

test_csv_scanFunction · 0.85
planFunction · 0.85
make_session_stateFunction · 0.85
buildMethod · 0.45
schemaMethod · 0.45
as_refMethod · 0.45
execution_propsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…