Skip to content

Optimizing LogicalPlan with placeholders fails #8819

@simonvandel

Description

@simonvandel

Describe the bug

Optimizing a LogicalPlan with a placeholder fails with the error: "Placeholder type could not be resolved".

To Reproduce

 #[tokio::test]
    async fn fails() {
        let ctx = SessionContext::new();

        let df = ctx
            .read_empty()
            .unwrap()
            .with_column("a", lit(1))
            .unwrap()
            .filter(col("a").eq(placeholder(":0")))
            .unwrap();
        let logical_plan = df.logical_plan();

        // Fails with: Placeholder type could not be resolved
        ctx.state().optimize(logical_plan).unwrap();
    }

Expected behavior

The optimizer does not fail at the placeholder, but optimizes as much as it can with the info it has.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions