Mihaly Szjatinya has uploaded this change for review. ( 
https://gerrit.cloudera.org/25412


Change subject: IMPALA-15775: Prefer HMS stats over Puffin stats of the same 
snapshot
......................................................................

IMPALA-15775: Prefer HMS stats over Puffin stats of the same snapshot

When an Iceberg table has both HMS and Puffin NDV stats for a column,
PuffinStatsLoader compares the snapshot stored for the column in the
'impala.computeStatsSnapshotIds' table property with the snapshot of
the Puffin blob. IMPALA-14261 switched this comparison from timestamps
to snapshot ids and used a strict "more recent" check, so when both
stats belong to the same snapshot, the Puffin stats were used. Before
that, the check was 'hmsStatsTimestampMs_ >= snapshotTs', i.e. HMS
stats won the tie, as the comment of hmsHasMoreRecentStats() still
says.

As a result, HMS stats of the current snapshot were ignored whenever
Puffin stats existed for the same snapshot, e.g. a manual
ALTER TABLE ... SET COLUMN STATS after COMPUTE STATS had no effect.

This patch makes hmsHasMoreRecentStats() return true if the HMS and
Puffin stats belong to the same snapshot, and documents the tie rule.
This is needed for IMPALA-15004, where COMPUTE STATS writes both HMS
and Puffin stats for the same snapshot.

Testing:
 - Extended test_stats_before_and_after_HMS_stats with a column whose
   HMS and Puffin stats belong to the same snapshot.

Change-Id: I829653dcb77e930a655187446496bbbe7ec5e81f
Assisted-by: Claude Opus 4.8 (GitHub Copilot)
---
M docs/topics/impala_iceberg.xml
M fe/src/main/java/org/apache/impala/catalog/PuffinStatsLoader.java
M tests/query_test/test_iceberg.py
3 files changed, 18 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/12/25412/1
--
To view, visit https://gerrit.cloudera.org/25412
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I829653dcb77e930a655187446496bbbe7ec5e81f
Gerrit-Change-Number: 25412
Gerrit-PatchSet: 1
Gerrit-Owner: Mihaly Szjatinya <[email protected]>

Reply via email to