trino: Trino 356 : Deletion of partitions is not happening

Overview The partitions are not getting dropped when the delete query matches the partition referenced from a subquery.

we are using 356 for the QA env where this issue is persistent, whereas on prod which is using 347 the issue is not.

trino> create table pso_test.par_and_buck_by1 (a varchar, b int, c varchar) WITH ( format = 'ORC', partitioned_by = ARRAY['c'], bucketed_by = ARRAY['a'], bucket_count = 10, transactional=true);
CREATE TABLE
trino> insert into pso_test.par_and_buck_by1 values ('a',1,'a'), ('b',2,'b');
INSERT: 2 rows
trino> select * from pso_test.par_and_buck_by1;
 a | b | c 
---+---+---
 b | 2 | b 
 a | 1 | a 
(2 rows)
trino> select * from pso_test."par_and_buck_by1$partitions";
 c 
---
 a 
 b 
(2 rows)
trino> delete from pso_test.par_and_buck_by1 where c in ('a','b');
DELETE: 2 rows

or 

trino> delete from pso_test.par_and_buck_by1 where c ='a' or c='b';
DELETE: 2 rows
trino> select * from pso_test."par_and_buck_by1$partitions";
 c 
---
 a 
 b 
(2 rows)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

@vinay-kl Regarding your use case, do you actually need transactional tables? Do you ever do row level deletes or take advantage of the ACID semantics? If not, then making the tables non-transactional should solve your problem.