Skip to content

[Bug] CDC computed column arguments are upper-cased when the catalog is case-insensitive #9716

Description

@NestDream

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master (d77efe0). Also 1.3.x and 1.4.x, introduced by #5972.

Compute Engine

Flink 1.20.1, kafka_sync_table with canal-json.

Minimal reproduce step

  1. Catalog with case-sensitive=false (the Hive catalog default). Create the table first: orders (id INT, create_time TIMESTAMP(3), dt STRING, PRIMARY KEY (id, dt) NOT ENFORCED) PARTITIONED BY (dt).
  2. Start kafka_sync_table on an empty canal-json topic with --computed_column 'dt=date_format(create_time,yyyy-MM-dd)'. The table exists and no record is available, so the job builds the computed column from the Paimon schema with caseSensitive=false.
  3. Produce one record with create_time = 2023-03-23 10:15:00.

What doesn't meet your expectations?

The record lands in partition dt=2023-03-82 instead of dt=2023-03-23, with no error. sortComputedColumnArgs upper-cases the whole argument, so the pattern becomes YYYY-MM-DD (week year, day of year).

Two more effects of the same upper-casing: with lower-case source column names the job restarts on every record with Cannot write null to non-null column(dt), because the upper-cased reference does not match the record; and a computed column referencing another computed column fails with Referenced field '...' is not in given fields.

Anything else?

Introduced by #5972, which upper-cases the whole argument before parsing it.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions