[C++] Convert `SingularOrList` to `is_in` when possible
Open
Component: C++
Type: enhancement
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the enhancement requested
Currently, when we encounter `SingularOrList` from Substrait, we convert it into an or list. In other words, `expr1 || expr2 || expr3 || expr4`. However, when all of the expressions are of the form `field == literal` (where `field` is the same) then we can replace it with `is_in(field, [literal1, literal2, ..., literalN])`.
This is arguably a little bit on the "planner/optimizer" slippery slope but it's a simple enough optimization and we already have an `is_in` function so I think it's a reasonable one to apply.
### Component(s)
C++
Contributor guide
Assessment
This issue has not been assessed yet.