Trino shows stale (pre-truncation) data when reading a truncated Hive ACID table before compaction runs
Author: thierryczCreated Sep 23, 2026Updated Sep 23, 2026
Trino version
483
Please describe the bug
- Description
When accessing a CDP Private Cloud Base cluster while reading a Hive ACID table that was truncated before compaction has run, Trino displays the table as before truncation.
- Example
with beeline
create table t1 as select 1 x;
insert into t1 values (2);
select * from t1;
+-------+
| t1.x |
+-------+
| 1 |
| 2 |
+-------+
truncate table t1;
select * from t1;
+-------+
| t1.x |
+-------+
+-------+from trino cli
select * from t1;
x
---
2
1
(2 rows)- Expected behaviour
trino returns no rows like beeline
- Proposed fix
when truncating a table in hive, it create a base_xxxxxx folder with a _metadata_acid text file inside
trino side when listing files in the table folder the files starting with _ or . are ignored and so the folder containing them.
if (!path.contains("/_") && !path.contains("/.")) {
files.add(file);the base folder is then ignored and the rest of delta folders are read like normal, displaying old rows
Source: trinodb/trino