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

Aitozi commented on FLINK-29748:
--------------------------------


{noformat}
The rule will only apply once during the optimization because the rule uses hep 
optimizer which is not based on the cost.
{noformat}

Yes you are right. My {{optimization}} words mainly point to the whole planner 
phase, so the connector do not know whether the optimizeĀ is finished or not.
As a workaround, I think we can add the callback interface eg: 
{{onOptimizeFinished}} or {{onTranslateExecNodeStart}} on the 
{{ScanTableSource}} . All the external validation work on the final results can 
perform on that stage. what do you think about it ?

> Expose the optimize phase in the connector context
> --------------------------------------------------
>
>                 Key: FLINK-29748
>                 URL: https://issues.apache.org/jira/browse/FLINK-29748
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / Planner, Table SQL / Runtime
>            Reporter: Aitozi
>            Priority: Minor
>
> Currently, in the connector it can not know whether the whole optimize is 
> finished.
> When the optimize finished, the all information is static, eg: the reading 
> partitions. If I want to validate the final optimized result (like whether 
> the reading partition is too much or empty), it needs the context of what is 
> the current phase. I think the {{ScanContext}} is ok to expose this 
> information. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to