Skip to content

Not evaluate the set expr in the InList for the optimization #2820

@liukun4515

Description

@liukun4515

Describe the bug
From this pr #2156, @Ted-Jiang optimize the inlist using the set scalar.

But get the static value from below code:

fn cast_static_filter_to_set(list: &[Arc<dyn PhysicalExpr>]) -> HashSet<ScalarValue> {
    HashSet::from_iter(list.iter().map(|expr| {
        if let Some(cast) = expr.as_any().downcast_ref::<expressions::CastExpr>() {
            cast.expr()
                .as_any()
                .downcast_ref::<expressions::Literal>()
                .unwrap()
                .value()
                .clone()
        } else {
            expr.as_any()
                .downcast_ref::<expressions::Literal>()
                .unwrap()
                .value()
                .clone()
        }
    }))
}

This will not get the right value for the set expr.
We should eval the set expr to get the set scalar values.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

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