Ted-Jiang opened a new issue, #4398: URL: https://github.com/apache/arrow-datafusion/issues/4398
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
```
❯ explain select l_orderkey from lineitem where l_extendedprice='2618.76';
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| plan_type | plan
|
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| logical_plan | Projection: lineitem.l_orderkey
|
| | Filter: CAST(lineitem.l_extendedprice AS Utf8) =
Utf8("2618.76")
|
| | TableScan: lineitem projection=[l_orderkey,
l_extendedprice], partial_filters=[CAST(lineitem.l_extendedprice AS Utf8) =
Utf8("2618.76")]
|
| physical_plan | ProjectionExec: expr=[l_orderkey@0 as l_orderkey]
|
| | CoalesceBatchesExec: target_batch_size=4096
|
| | FilterExec: CAST(l_extendedprice@1 AS Utf8) = 2618.76
|
| | RepartitionExec: partitioning=RoundRobinBatch(16)
|
| | ParquetExec: limit=None, partitions=*.parquet],
predicate=CAST(l_extendedprice AS Utf8) = Utf8("2618.76"),
projection=[l_orderkey, l_extendedprice] |
| |
|
+---------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set. Query took 0.017 seconds.
```
In this sql will have two related cols:
1. `Selected` col `l_orderkey`
2. `Filter` col `l_extendedprice`
IMO, this situation where `Filter Col` not exists in `Selected col`, is
perfect for row_filter_push_down. We can only visit the `Filter Col` once,
without using the `selection` do the decoding thing.
**Describe the solution you'd like**
Maybe we can change the physical plan to
```
| physical_plan | ProjectionExec: expr=[l_orderkey@0 as l_orderkey]
|
| | CoalesceBatchesExec: target_batch_size=4096
|
|
| | RepartitionExec: partitioning=RoundRobinBatch(16)
|
| | ParquetExec: limit=None, partitions=[*.parquet],
predicate=CAST(l_extendedprice AS Utf8) = Utf8("2618.76"),
projection=[l_orderkey] |
| |
```
**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]
