[
https://issues.apache.org/jira/browse/FLINK-41677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18152778#comment-18152778
]
Gustavo de Morais commented on FLINK-41677:
-------------------------------------------
Fixed in apache/flink:master 75a3d070198c9bd2957a953f54f257aa8387b2c5
> Remove ChangelogNormalize below PTFs that ignore retractions: TO_CHANGELOG
> with an insert/update-only op_mapping
> ----------------------------------------------------------------------------------------------------------------
>
> Key: FLINK-41677
> URL: https://issues.apache.org/jira/browse/FLINK-41677
> Project: Flink
> Issue Type: Improvement
> Components: Table SQL / Planner
> Reporter: Gustavo de Morais
> Assignee: Gustavo de Morais
> Priority: Major
>
> Part of removing unnecessary {{ChangelogNormalize}} below built-in PTFs that
> ignore retractions (e.g. {{TO_APPEND}}), see
> [apache/flink#30123|https://github.com/apache/flink/pull/30123].
> {{TO_CHANGELOG}} with an {{op_mapping}} that maps only INSERT and
> UPDATE_AFTER never reads UPDATE_BEFORE or DELETE rows. The planner still
> keeps a {{ChangelogNormalize}} below it in the same cases as for
> {{TO_APPEND}}, for example when the input has no upsert key:
> {code:sql}
> CREATE VIEW order_status AS SELECT status, amount FROM orders;
> SELECT * FROM TO_CHANGELOG(
> input => TABLE order_status,
> op_mapping => MAP['INSERT', 'INSERT', 'UPDATE_AFTER', 'UPDATE_AFTER']);
> {code}
> We should declare {{IGNORE_RETRACTIONS}} for {{TO_CHANGELOG}} with such an
> {{op_mapping}}, so it benefits from the same optimizations. Without the
> {{ChangelogNormalize}}, the op column shows the row kinds of the source, as
> it already does for inputs with an upsert key.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)