Gustavo de Morais created FLINK-41516:
-----------------------------------------
Summary: Row-semantic PTFs keep an unnecessary ChangelogNormalize
for upsert sources with full deletes
Key: FLINK-41516
URL: https://issues.apache.org/jira/browse/FLINK-41516
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Reporter: Gustavo de Morais
Assignee: Gustavo de Morais
Since FLINK-41371, row-semantic PTFs with insert-only output consume upsert
inputs directly. For an upsert source with full deletes, the planner still
keeps a {{ChangelogNormalize}} below the PTF, even though it emits the same
changelog it receives.
The delete-kind inference for PTF table arguments first requests key-only
deletes. The {{ChangelogNormalize}} answers with full deletes, which does not
satisfy the request, but the result is accepted without a check, so the
fallback to full deletes - which would remove the normalize - never runs.
{{visitChildren}} performs this check; the PTF branch calls {{visit}} directly.
Joins use the same pattern but are not affected, because an {{Exchange}} always
sits between them and the normalize.
We should only accept the key-only result if it satisfies the requested trait,
as {{visitChildren}} does.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)