ygf11 opened a new issue, #4914: URL: https://github.com/apache/arrow-datafusion/issues/4914
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
Create table:
```sql
❯ create table t1(a int, b int, c int) as values(1,1,1);
❯ create table t2(a int, b int, c int) as values(1,1,1);
```
run query:
```sql
❯ explain verbose select * from t1 where t1.a in (select t2.a from t2)
and t1.b in(select t2.b from t2)
and t1.c > 10;
```
The output plan of `decorrelate_where_in`:
```sql
| logical_plan after decorrelate_where_in | Projection:
t1.a, t1.b, t1.c
|
| | Filter:
t1.c > Int32(10) -- filter
|
| | LeftSemi
Join: t1.b = __correlated_sq_2.b
|
| | Filter:
t1.c > Int32(10) -- filter
|
| |
LeftSemi Join: t1.a = __correlated_sq_1.a
|
| |
TableScan: t1
|
| |
SubqueryAlias: __correlated_sq_1
|
| |
Projection: t2.a AS a
|
| |
TableScan: t2
|
| |
SubqueryAlias: __correlated_sq_2
|
| |
Projection: t2.b AS b
|
| |
TableScan: t2
```
We can see `Filter: t1.c > Int32(10)` happen twice.
**Describe the solution you'd like**
I would like add the `Filter` only once.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features
you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
