Rows visible in Trino after Hive ACID TRUNCATE: validate the transaction state
The consumer's approved post-TRUNCATE view matters more than whether old physical files still exist.
An empty state can be an explicit expectation
TRUNCATE semantics concern visibility under the current transaction state, not merely remaining files. Before deciding that a Truthound row-count check should accept 0, obtain independent evidence that truncation completed. This is different from approving every empty query as success. [1, 2, 3]
A pre-compaction reader disagreement
The public Trino report truncates a Hive ACID table. Hive reads it as empty, while Trino still exposes previous rows before compaction. Different readers reveal different views of the same logical state. Checking only physical deletion can miss the transaction-visibility issue. [1]
An illustrative same-generation comparison
For a generation with confirmed TRUNCATE completion and successful query execution, visible_rows must be 0. A consumer query returning 0 rows in that generation matches the approved empty state. Visibility of 2 previous rows violates the post-TRUNCATE contract. Do not apply that basis unchanged after legitimate new writes. Record the truncation watermark together with the query point. [1, 3]
Truthound and transaction evidence
Record the transaction watermark following truncation and verify that the consuming engine reflects the approved empty state. Truthound Core's RowCountValidator can apply exact_count=0 to the actual received table. It does not change Trino's interpretation of Hive transactions. Compare the approved Hive state with pre- and post-compaction reads to establish the correction's scope. [1, 2, 3]
Application conditions
Link the actual received table and reader_engine and visible_rows audit records to the completed truncate_generation, preserving an independent transaction watermark.
Alternatives
Compare pre- and post-compaction reads against the approved Hive transaction state.
Limitations
This is not a rule approving every empty result. Evidence of completed TRUNCATE and successful query execution is required first.
Evidence
- Event checked
- Subject checked
- Modified
