Skip to content

Do some pre-check when building LogicalPlan #2041

@doki23

Description

@doki23

Actually, it's not a functionality bug. It's my confusion about the unit test: logical_plan::builder::tests::plan_using_join_wildcard_projection

The following is some code in the test.

let plan = LogicalPlanBuilder::scan_empty(Some("t1"), &employee_schema(), None)?
            .join_using(&t2, JoinType::Inner, vec!["id"])?
            .project(vec![Expr::Wildcard])? // my question about here
            .build()?;

I find some error descriptions in other place of sql planner like:

Expr::Wildcard { .. } => Err(DataFusionError::Internal(
            "Wildcard expressions are not valid in a logical query plan".to_owned(),
        ))

And in the sql planner, we always expand the wildcard before generating a logical plan.
So the unit test may be wrong, please correct me if I am wrong.

We should do some pre-check for building LogicalPlan to expose errors earlier.
For example, SELECT id, first_name, last_name FROM person WHERE NOT id

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