Skip to content

[Bug] An out-of-range tag year can prevent automatic tag creation on later writes #11301

Open

Description

@taoran92

Search before asking

  • I searched the issues. #3346 concerns an unset watermark (Long.MIN_VALUE). Here the supplied watermark yields an hourly tag whose year exceeds four digits.

Paimon version

2.1 & 2.2-SNAPSHOT

Compute Engine

Flink SQL 1.20.3, batch mode

Minimal reproduce step

Start a Flink SQL session with the Paimon connector for Flink 1.20.

SET 'execution.runtime-mode' = 'batch';

CREATE CATALOG IF NOT EXISTS paimon_test WITH (
  'type' = 'paimon',
  'warehouse' = 'file:///tmp/paimon-test-warehouse'
);
USE CATALOG paimon_test;

CREATE DATABASE IF NOT EXISTS test_db;
USE test_db;

CREATE TABLE t (k INT, v INT) WITH (
  'bucket' = '1',
  'bucket-key' = 'k',
  'tag.automatic-creation' = 'watermark',
  'tag.creation-period' = 'hourly'
);

-- end-input.watermark expects epoch milliseconds. This job supplies epoch microseconds by mistake.
INSERT INTO t /*+ OPTIONS('end-input.watermark' = '1726000000000000') */ VALUES (1, 11);

-- The next job supplies epoch milliseconds for an event one hour later.
INSERT INTO t /*+ OPTIONS('end-input.watermark' = '1726003600000') */ VALUES (2, 22);

After each INSERT finishes, run these queries to inspect the committed watermark and any hourly tags.

SELECT snapshot_id, `watermark`, total_record_count
FROM paimon_test.test_db.`t$snapshots`
ORDER BY snapshot_id;

SELECT tag_name, snapshot_id
FROM paimon_test.test_db.`t$tags`
ORDER BY snapshot_id, tag_name;

What doesn't meet your expectations?

Expected

The first INSERT should report that the hourly tag year is out of range before publishing the snapshot. A later write with a valid millisecond watermark should be able to create its tag.

Actual

The first INSERT succeeds and publishes snapshot 1 with watermark 1726000000000000. Its hourly tag is missing. The second INSERT also succeeds and publishes snapshot 2 with the same watermark, even though it supplied 1726003600000. The table still has no tags. Both jobs log the following error during tag creation.

java.time.DateTimeException: Field Year cannot be printed as the value 56664 exceeds the maximum print width of 4

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. changed the title [-][Bug] A microsecond end-input.watermark can cause hourly tag creation to fail on later writes[/-] [+][Bug] A microsecond end-input.watermark can cause automatic tag creation to fail on later writes[/+] on Nov 20, 2026
  2. changed the title [-][Bug] A microsecond end-input.watermark can cause automatic tag creation to fail on later writes[/-] [+][Bug] An out-of-range tag year can prevent automatic tag creation on later writes[/+] on Nov 20, 2026
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