[ 
https://issues.apache.org/jira/browse/FLINK-41676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gustavo de Morais updated FLINK-41676:
--------------------------------------
    Description: 
Part of removing unnecessary {{ChangelogNormalize}} below built-in PTFs that 
skip retractions (e.g. {{TO_APPEND}}), see 
[apache/flink#30123|https://github.com/apache/flink/pull/30123].

A filter on non-key columns of an upsert source is pushed into 
{{ChangelogNormalize}}, which is then always kept. The filter only affects the 
retractions that {{ChangelogNormalize}} produces.

{code:sql}
CREATE VIEW paid_orders AS SELECT * FROM orders WHERE status = 'PAID';
SELECT * FROM TO_APPEND(input => TABLE paid_orders);
{code}

If the consumer skips retractions, we should remove the {{ChangelogNormalize}} 
and keep its filter as a regular Calc. Sources with key-only deletes keep the 
{{ChangelogNormalize}}, since the filter cannot be evaluated on a tombstone.

  was:
A filter on non-key columns of an upsert source is pushed into 
{{ChangelogNormalize}}, which is then always kept. The filter only affects the 
retractions that {{ChangelogNormalize}} produces.

{code:sql}
CREATE VIEW paid_orders AS SELECT * FROM orders WHERE status = 'PAID';
SELECT * FROM TO_APPEND(input => TABLE paid_orders);
{code}

If the consumer skips retractions, we should remove the {{ChangelogNormalize}} 
and keep its filter as a regular Calc. Sources with key-only deletes keep the 
{{ChangelogNormalize}}, since the filter cannot be evaluated on a tombstone.

        Summary: Remove ChangelogNormalize below PTFs that skip retractions: 
non-key filters  (was: Remove ChangelogNormalize for filters below PTFs that 
skip retractions)

> Remove ChangelogNormalize below PTFs that skip retractions: non-key filters
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-41676
>                 URL: https://issues.apache.org/jira/browse/FLINK-41676
>             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 
> skip retractions (e.g. {{TO_APPEND}}), see 
> [apache/flink#30123|https://github.com/apache/flink/pull/30123].
> A filter on non-key columns of an upsert source is pushed into 
> {{ChangelogNormalize}}, which is then always kept. The filter only affects 
> the retractions that {{ChangelogNormalize}} produces.
> {code:sql}
> CREATE VIEW paid_orders AS SELECT * FROM orders WHERE status = 'PAID';
> SELECT * FROM TO_APPEND(input => TABLE paid_orders);
> {code}
> If the consumer skips retractions, we should remove the 
> {{ChangelogNormalize}} and keep its filter as a regular Calc. Sources with 
> key-only deletes keep the {{ChangelogNormalize}}, since the filter cannot be 
> evaluated on a tombstone.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to