Description
Similar to CALCITE-1876.
Projects are not pushed to BindableTableScan when using ProjectableFilterableTable with aggregate functions.
The reason is that the cost of BindableTableScan does not use projects (and filters), so the planner chooses a plan with Project node removed by ProjectRemoveRule.
By tweaking the cost to use the number of used projects solved the problem.
Any suggestion on the cost formula to take both projects and filters into account?