Jark Wu created FLINK-36736:
-------------------------------

             Summary: DynamicTableSink.Context#getTargetColumns should contains 
all the columns that sink function will receive
                 Key: FLINK-36736
                 URL: https://issues.apache.org/jira/browse/FLINK-36736
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Planner
            Reporter: Jark Wu
            Assignee: luoyuxia
             Fix For: 1.20.1


If there is an update statement {{UPDATE t1 SET a = 1 WHERE id = 2}} on the 
table t1 with schema {{[int id, int a, string b]}}, the 
{{DynamicTableSink.Context#getTargetColumns}} will return only the updated 
column {{[a]}}. This is incorrect and should return column {{[id, a]}}.

Because underlying, the update statement should be translated into {{INSERT 
INTO t1 (id, a) SELECT id, a FROM t1 WHERE id = 2}}, and the target column of 
{{INSERT INTO}} is {{id, a}}. Without the column {{id}}, sink function can't 
apply the updated values to the specified rows. 




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to