[
https://issues.apache.org/jira/browse/FLINK-14621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18077847#comment-18077847
]
Dennis-Mircea Ciupitu commented on FLINK-14621:
-----------------------------------------------
I've implemented this and it's ready for review. The fix is a new HEP rule,
{{{}RedundantWatermarkAssignerRemoveRule{}}}, that runs in {{PHYSICAL_REWRITE}}
and drops {{StreamPhysicalWatermarkAssigner}} nodes whose watermarks aren't
consumed by any downstream operator ({{{}requireWatermark(){}}} rels,
{{CURRENT_WATERMARK}} calls, rowtime {{{}TemporalSort{}}}). It's anchored on
the HEP root, so it covers {{{}INSERT INTO{}}}, statement sets,
{{{}EXPLAIN{}}}, and Table API {{{}toDataStream{}}}/{{{}toChangelogStream{}}}.
When a sink (or root) consumes a rowtime column, the rule tracks the protected
indexes per branch and only keeps the assigners that actually feed them. Tested
with a new {{RedundantWatermarkAssignerRemoveRuleTest}} (13 cases) plus
regenerated goldens across the planner suite. No runtime / state / checkpoint
impact; {{EXPLAIN}} and compiled JSON plans change where the assigner is now
elided. PR: Would appreciate a review when someone has time.
> Do not generate watermark assigner operator if no time attribute operations
> on rowtime
> --------------------------------------------------------------------------------------
>
> Key: FLINK-14621
> URL: https://issues.apache.org/jira/browse/FLINK-14621
> Project: Flink
> Issue Type: New Feature
> Components: Table SQL / Planner
> Reporter: Jark Wu
> Priority: Major
> Labels: pull-request-available
>
> Currently, if watermark is specified in DDL, there is always a watermark
> assigner operator generated. However, it is only needed when time attribute
> operations (e.g. windows) on the rowtime.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)