[ 
https://issues.apache.org/jira/browse/FLINK-3848?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15652132#comment-15652132
 ] 

Fabian Hueske commented on FLINK-3848:
--------------------------------------

Yes, you're both right. The optimizer should identify that the TableSource 
supports projection push-down and push the projection into the TableSource. The 
user should not have to interact with the TableSource directly (apart from 
registering it as a Table in the TableEnvironment). 

IIRC, I had some problems specify the optimizer rules when I tried to implement 
this feature. I saw [this 
mail|https://lists.apache.org/thread.html/5896f4e834e976f146f280d279bf24c111c32476d96ae48d0f3c0d25@%3Cdev.calcite.apache.org%3E]
 a few days ago on the Calcite dev list. Maybe it helps to define the rule.

> Add ProjectableTableSource interface and translation rule
> ---------------------------------------------------------
>
>                 Key: FLINK-3848
>                 URL: https://issues.apache.org/jira/browse/FLINK-3848
>             Project: Flink
>          Issue Type: New Feature
>          Components: Table API & SQL
>            Reporter: Fabian Hueske
>            Assignee: Anton Solovev
>
> Add a {{ProjectableTableSource}} interface for {{TableSource}} implementation 
> that support projection push-down.
> The interface could look as follows
> {code}
> def trait ProjectableTableSource {
>   def setProjection(fields: Array[String]): Unit
> }
> {code}
> In addition we need Calcite rules to push a projection into a TableScan that 
> refers to a {{ProjectableTableSource}}. We might need to tweak the cost model 
> as well to push the optimizer in the right direction.
> Moreover, the {{CsvTableSource}} could be extended to implement 
> {{ProjectableTableSource}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to