Nándor Kollár created IMPALA-15730:
--------------------------------------
Summary: ALTER TABLE DROP PARTITION can empty the whole table for
Iceberg V2 tables
Key: IMPALA-15730
URL: https://issues.apache.org/jira/browse/IMPALA-15730
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Nándor Kollár
{{ALTER TABLE DROP PARTITION}} can empty the whole table for Iceberg V2 tables.
A delete file shared by several data files is added once per data file. If the
list size happens to equal {{getTotalNumberOfFiles()}}, {{isIcebergTruncate_}}
is set, and the catalog runs {{deleteFromRowFilter(alwaysTrue())}}, removing
every partition.
Steps to reproduce:
{code}
CREATE TABLE dp (id INT, p INT) PARTITIONED BY SPEC (p) STORED AS ICEBERG
TBLPROPERTIES('format-version'='2');
INSERT INTO dp VALUES (1,1),(11,1);
INSERT INTO dp VALUES (2,1),(12,1);
INSERT INTO dp VALUES (3,2);
DELETE FROM dp WHERE id IN (1,2);
ALTER TABLE dp DROP PARTITION (p=1);
SELECT count(*) FROM dp; -- expected 1 (p=2), actual 0
{code}
This v3 tables with delete vectors are safe.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)