Dandandan opened a new issue, #3839:
URL: https://github.com/apache/arrow-datafusion/issues/3839
**Is your feature request related to a problem or challenge? Please describe
what you are trying to do.**
For q17 this is the optimized plan.
```
Projection: CAST(SUM(lineitem.l_extendedprice) AS Decimal128(38, 33)) /
Decimal128(Some(7000000000000000195487369212723200),38,33) AS avg_yearly
Aggregate: groupBy=[[]], aggr=[[SUM(lineitem.l_extendedprice)]]
Filter: CAST(lineitem.l_quantity AS Decimal128(38, 21)) < __sq_1.__value
Inner Join: part.p_partkey = __sq_1.l_partkey
Inner Join: lineitem.l_partkey = part.p_partkey
TableScan: lineitem projection=[l_partkey, l_quantity,
l_extendedprice]
Filter: part.p_brand = Utf8("Brand#23") AND part.p_container =
Utf8("MED BOX")
TableScan: part projection=[p_partkey, p_brand, p_container]
Projection: lineitem.l_partkey,
Decimal128(Some(200000000000000000000),38,21) * CAST(AVG(lineitem.l_quantity)
AS Decimal128(38, 21)) AS __value, alias=__sq_1
Aggregate: groupBy=[[lineitem.l_partkey]],
aggr=[[AVG(lineitem.l_quantity)]]
TableScan: lineitem projection=[l_partkey, l_quantity,
l_extendedprice]
```
Looking at the filter `CAST(lineitem.l_quantity AS Decimal128(38, 21)) <
__sq_1.__value` it seems this one can be pushed down one level below the join,
as all fields are available before the join and it is an inner join.
**Describe the solution you'd like**
Fix filter pushdown for this case.
**Describe alternatives you've considered**
**Additional context**
--
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]