Skip to content

Iceberg Alter partition creates NULL partitioning #26503

@PPL-TBSK

Description

@PPL-TBSK

Is our issue related to this issue #26492 ?
Is this other issue?
Or is our issue expected behaviour?
Trino version used - Starburst 474-e1

Steps to reproduce:


create table test 
(
    a int,
    b int
)
with (partitioning = array['truncate(a,10)'])
;

show create table test;

insert into test select 10,0;
insert into test select 20,0;
insert into test select 30,0;
select * from "test$partitions";

returns 3 partitions { a_trunc = 30 }, { a_trunc = 20 }, { a_trunc = 10 }

ALTER TABLE test SET PROPERTIES partitioning = array['truncate(a,20)'];

select * from "test$partitions";

returns 3 partitions { a_trunc = 30, a_trunc = NULL }, { a_trunc = 20, a_trunc = NULL }, { a_trunc = 10, a_trunc = NULL }
Basically same partitions but with a_trunc = NULL being second partition column

set session iceberg.expire_snapshots_min_retention = '0d';
set session iceberg.remove_orphan_files_min_retention = '0d';


alter table test execute optimize (file_size_threshold => '1200MB');
ALTER TABLE test EXECUTE expire_snapshots(retention_threshold => '0d');
ALTER TABLE test EXECUTE remove_orphan_files(retention_threshold => '0d');

select * from "test$partitions";

returns 2 partitions { a_trunc = NULL, a_trunc = 0 }, { a_trunc = NULL, a_trunc = 20 }
with first partition column being a_trunc = NULL. Is this expected behaviour after optimizing the whole table and deleting all the old data files?
Or is this Issue related to our issue? Each time we would change partitioning on a_trunc column more and more a_trunc = NULL partitionings would be created.

Thanks

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