Skip to content

HIVE-29803: [Iceberg] Support ANCESTORS_OF snapshot lineage command - #6681

Open
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29803
Open

HIVE-29803: [Iceberg] Support ANCESTORS_OF snapshot lineage command#6681
Aggarwal-Raghav wants to merge 1 commit into
apache:masterfrom
Aggarwal-Raghav:HIVE-29803

Conversation

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Introduce, ANCESTORS_OF command for Iceberg tables, allowing users to inspect the snapshot history and rollback lineage natively in Hive.

Why are the changes needed?

To improve Iceberg metadata visibility. This brings Hive closer to feature parity with Spark, which natively support inspecting Iceberg snapshot history and lineage chains.

Does this PR introduce any user-facing change?

Yes, New DDL

-- Trace lineage from the current snapshot
ALTER TABLE my_iceberg_table EXECUTE ANCESTORS_OF;

-- Trace lineage backwards from a specific historical snapshot
ALTER TABLE my_iceberg_table EXECUTE ANCESTORS_OF(2141260513344612246);

How was this patch tested?

On local setup

@Aggarwal-Raghav

Aggarwal-Raghav commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Beeline output
Screenshot 2026-08-07 at 1 22 18 AM

Screenshot 2026-08-07 at 1 24 06 AM

HS2 logs

2026-08-07T01:22:02,573  INFO [HiveServer2-Background-Pool: Thread-102] hive.HiveIcebergSerDe: Using schema from existing table {"type":"struct","schema-id":0,"fields":[{"id":1,"name":"id","required":false,"type":"int"},{"id":2,"name":"data","required":false,"type":"string"}]}
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: +---------------------------+---------------------------+
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: |        snapshot_id        |       timestamp_ms        |
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: +---------------------------+---------------------------+
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: | 2141260513344612246       | 1786040238769             |
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: | 5908440916579273721       | 1786039781897             |
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: | 5008121964096893521       | 1786039777510             |
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] SessionState: +---------------------------+---------------------------+
2026-08-07T01:22:02,577  INFO [HiveServer2-Background-Pool: Thread-102] metadata.Hive: Dumping metastore api call timing information for : execution phase

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants