liuml07 commented on code in PR #4709:
URL: https://github.com/apache/iceberg/pull/4709#discussion_r979350065
##########
docs/spark-queries.md:
##########
@@ -394,3 +394,22 @@
spark.read.format("iceberg").load("db.table.files").show(truncate = false)
// Hadoop path table
spark.read.format("iceberg").load("hdfs://nn:8020/path/to/table#files").show(truncate
= false)
```
+
+### Time Travel with Metadata Tables
+
+To inspect a tables's metadata with the time travel feature:
+
+```sql
+-- get the table's file manifests at timestamp Sep 20, 2021 08:00:00
+SELECT * FROM prod.db.table.manifests TIMESTAMP AS OF '2021-09-20 08:00:00';
+
+-- get the table's partitions with snapshot id 10963874102873L
+SELECT * FROM prod.db.table.partitions VERSION AS OF 10963874102873;
+```
+
+Metadata tables can also be inspected with time travel using the
DataFrameReader API:
+
+```scala
+// get table's data files and each data file's metadata at snapshot-id
10963874102873
+spark.read.format("iceberg").option("snapshot-id",
10963874102873L).load("db.table.files").show()
Review Comment:
Yeah this makes perfect sense - `show()` is totally irrelevant and also we
do not attach result examples here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]