[
https://issues.apache.org/jira/browse/CALCITE-2044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16243983#comment-16243983
]
Luis Fernando Kauer commented on CALCITE-2044:
----------------------------------------------
ProjectableFilterableTable is meant for simple uses.
I opened this Jira to solve the common problem of projects not being pushed to
the table scan with aggregate.
I propose a simple solution, without the need to implement any other interface,
just by reducing the cost when projects and filters are applied.
You are proposing a new feature that would allow more control of the cost, but
Calcite already has many pluggable ways to control costs and provide
statistics, and you should try them first. See Statistics, RelMetadataQuery,
BuiltInMetadata ...
You can also use TranslatableTable and have full control. I know, the csv
example does not include filter push down. Maybe we could improve the example
to include it to show how it can be done.
> Tweak cost of BindableTableScan to make sure Project is pushed through
> Aggregate
> --------------------------------------------------------------------------------
>
> Key: CALCITE-2044
> URL: https://issues.apache.org/jira/browse/CALCITE-2044
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Luis Fernando Kauer
> Assignee: Julian Hyde
> Priority: Minor
>
> 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?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)