Gustavo de Morais created FLINK-41816:
-----------------------------------------
Summary: Check input determinism for PTFs that read retractions
Key: FLINK-41816
URL: https://issues.apache.org/jira/browse/FLINK-41816
Project: Flink
Issue Type: Improvement
Components: Table SQL / Planner
Reporter: Gustavo de Morais
The non-deterministic update check
({{StreamNonDeterministicUpdatePlanVisitor#visitPtf}}) only requires the
PARTITION BY columns of a PTF input to be deterministic, unless the table
argument declares {{REQUIRE_UPDATE_BEFORE}}. That trait also forces -U on every
input, so a PTF that reads -U/-D rows when they are delivered, but does not
need them otherwise, cannot declare it. If such a PTF matches a retraction to
the row it removes by its content, a non-deterministic column makes the
retraction miss under TRY_RESOLVE without any error. {{DEDUPLICATE}} with
several rows per key is an example.
We should let a table argument declare that it reads retractions when they are
delivered, and then require all input columns to be deterministic whenever the
input carries -U, except the columns covered by an upsert key.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)