You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by "yux (Jira)" <ji...@apache.org> on 2024/04/28 06:36:00 UTC

[jira] [Created] (FLINK-35256) Pipeline transform ignores column type nullability

yux created FLINK-35256:
---------------------------

             Summary: Pipeline transform ignores column type nullability
                 Key: FLINK-35256
                 URL: https://issues.apache.org/jira/browse/FLINK-35256
             Project: Flink
          Issue Type: Improvement
          Components: Flink CDC
            Reporter: yux
         Attachments: log.txt

Flink CDC 3.1.0 brought transform feature, allowing column type / value transformation prior to data routing process. However after the transformation, column type marked as `NOT NULL` lost their annotation, causing some downstream sinks to fail since they require primary key to be NOT NULL.

Here's the minimum reproducible example about this problem:

```yaml
source:
  type: mysql
  ...

sink:
  type: starrocks
  name: StarRocks Sink
  ...

pipeline:
  name: Sync MySQL Database to StarRocks
  parallelism: 4

transform:
  - source-table: reicigo.\.*
    projection: ID, UPPER(ID) AS UPID
```

In the MySQL source table, primary key column `ID` is marked as `NOT NULL`, but such information was lost at downstream, causing the following exception (see attachment).



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