Skip to content

[Bug] Changing partition.default-name on a non-empty table makes existing files unreadable #11459

Backlog

Description

@Yibo-Dong

Search before asking

  • I searched in the issues and found nothing similar.

Paimon version

master (88792ed, 2026-11-24) and 2.1.0

Compute Engine

Flink 1.20.5 (SQL Client, batch mode)

Minimal reproduce step

CREATE CATALOG c WITH ('type' = 'paimon', 'warehouse' = 'file:/tmp/paimon_partition_default_name');
USE CATALOG c;

CREATE TABLE t (id INT, p STRING) PARTITIONED BY (p);
INSERT INTO t VALUES (1, CAST(NULL AS STRING)), (2, 'a');
SELECT * FROM t;

ALTER TABLE t SET ('partition.default-name' = 'null_part');
-- control: the non-null partition is still readable
SELECT * FROM t WHERE p = 'a';
-- writing a NULL partition value after the change succeeds
INSERT INTO t VALUES (3, CAST(NULL AS STRING));

-- switching back to the original value does not help: the table cannot be read any more
ALTER TABLE t RESET ('partition.default-name');
SELECT * FROM t;

What doesn't meet your expectations?

Expected: the option is either rejected for a table that already has data (like other options that determine the physical layout, e.g. data-file.path-directory or bucket-key), or existing files stay readable. SELECT * FROM t should return (1,NULL) (2,a) (3,NULL).

Actual: every ALTER succeeds, the first SELECT returns (2,a) (1,NULL), the control SELECT ... WHERE p = 'a' returns (2,a), the INSERT succeeds, and the final SELECT fails:

java.io.FileNotFoundException: File 'file:/tmp/paimon_partition_default_name/default.db/t/p=__DEFAULT_PARTITION__/bucket-0/data-....parquet' not found

The file written after the change lives under p=null_part, the older one under p=__DEFAULT_PARTITION__. With null_part set, the old file is not found (SELECT * FROM t directly after the ALTER fails with .../p=null_part/bucket-0/data-....parquet not found); with the option reset, the new file is not found. Once a NULL partition value has been written after the change, the table cannot be read with any value of the option.

partition.legacy-name has the same problem: create t (id INT, d DATE) PARTITIONED BY (d), insert DATE '2024-01-01', then ALTER TABLE t SET ('partition.legacy-name' = 'false'); the next SELECT * FROM t fails with FileNotFoundException: .../t/d=2024-01-01/bucket-0/data-....parquet not found, because the file was written under the legacy directory name.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

  1. added
    bug
    on Nov 25, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions