You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Changing partition.default-name on a non-empty table makes existing files unreadable #11459
CREATE CATALOG c WITH ('type'='paimon', 'warehouse'='file:/tmp/paimon_partition_default_name');
USE CATALOG c;
CREATETABLEt (id INT, p STRING) PARTITIONED BY (p);
INSERT INTO t VALUES (1, CAST(NULLAS STRING)), (2, 'a');
SELECT*FROM t;
ALTERTABLE t SET ('partition.default-name'='null_part');
-- control: the non-null partition is still readableSELECT*FROM t WHERE p ='a';
-- writing a NULL partition value after the change succeedsINSERT INTO t VALUES (3, CAST(NULLAS STRING));
-- switching back to the original value does not help: the table cannot be read any moreALTERTABLE 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.
Activity