Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-35256

Pipeline transform ignores column type nullability

    XMLWordPrintableJSON

Details

    Description

      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).

      Attachments

        1. log.txt
          6 kB
          yux

        Issue Links

          Activity

            People

              xiqian_yu yux
              xiqian_yu yux
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: