You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Jark Wu (Jira)" <ji...@apache.org> on 2021/01/22 05:54:02 UTC

[jira] [Closed] (FLINK-19446) canal-json has a situation that -U and +U are equal, when updating the null field to be non-null

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

Jark Wu closed FLINK-19446.
---------------------------
    Resolution: Fixed

Fixed in master: 6ee32ee4a4cc24f2e519545f6c032f06849f08d1

> canal-json has a situation that -U and +U are equal, when updating the null field to be non-null
> ------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-19446
>                 URL: https://issues.apache.org/jira/browse/FLINK-19446
>             Project: Flink
>          Issue Type: Bug
>          Components: Formats (JSON, Avro, Parquet, ORC, SequenceFile)
>    Affects Versions: 1.11.1
>            Reporter: shizhengchao
>            Assignee: Nicholas Jiang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.13.0
>
>
> line 118 in CanalJsonDeserializationSchema#deserialize method:
> {code:java}
> GenericRowData after = (GenericRowData) data.getRow(i, fieldCount);
> GenericRowData before = (GenericRowData) old.getRow(i, fieldCount);
> for (int f = 0; f < fieldCount; f++) {
> 	if (before.isNullAt(f)) {
> 		// not null fields in "old" (before) means the fields are changed
> 		// null/empty fields in "old" (before) means the fields are not changed
> 		// so we just copy the not changed fields into before
> 		before.setField(f, after.getField(f));
> 	}
> }
> before.setRowKind(RowKind.UPDATE_BEFORE);
> after.setRowKind(RowKind.UPDATE_AFTER);
> {code}
> if a field is null before update,it will cause -U and +U to be equal



--
This message was sent by Atlassian Jira
(v8.3.4#803005)