apache / apache/arrow

[C++] Convert `SingularOrList` to `is_in` when possible

Open
#36,535 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.