This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 22b92fe9e [doc] Optimize Spark3 DF time travel doc
22b92fe9e is described below
commit 22b92fe9ee4f9ba955df1e83c582ec4428d1de05
Author: JingsongLi <[email protected]>
AuthorDate: Thu Jul 6 17:30:22 2023 +0800
[doc] Optimize Spark3 DF time travel doc
---
docs/content/how-to/querying-tables.md | 45 +++++++++++++++-------------------
1 file changed, 20 insertions(+), 25 deletions(-)
diff --git a/docs/content/how-to/querying-tables.md
b/docs/content/how-to/querying-tables.md
index 952b5f4bf..5a454b70a 100644
--- a/docs/content/how-to/querying-tables.md
+++ b/docs/content/how-to/querying-tables.md
@@ -53,13 +53,27 @@ SELECT * FROM t /*+ OPTIONS('scan.tag-name' = 'my-tag') */;
{{< tab "Spark3" >}}
-#### DataFrame
+Requires Spark 3.3+.
+
+you can use `VERSION AS OF` and `TIMESTAMP AS OF` in query to do time travel:
+
+```sql
+-- read the snapshot with id 1L (use snapshot id as version)
+SELECT * FROM t VERSION AS OF 1;
+
+-- read the snapshot from specified timestamp
+SELECT * FROM t TIMESTAMP AS OF '2023-06-01 00:00:00.123';
-To select a specific table snapshot or the snapshot at some time in the
DataFrame API, Paimon supports:
+-- read the snapshot from specified timestamp in unix seconds
+SELECT * FROM t TIMESTAMP AS OF 1678883047;
+
+-- read tag 'my-tag'
+SELECT * FROM t VERSION AS OF 'my-tag';
+```
+
+{{< /tab >}}
-* `scan.snapshot-id` selects a specific table snapshot
-* `scan.timestamp-millis` selects the current snapshot at a timestamp, in
milliseconds
-* `scan.tag-name` selects a specific table snapshot by tag name
+{{< tab "Spark3-DF" >}}
```scala
// read the snapshot from specified timestamp in unix seconds
@@ -80,30 +94,11 @@ spark.read
```scala
// read tag 'my-tag'
spark.read
- .option(CoreOptions.SCAN_TAG_NAME.key(), "my-tag")
+ .option("scan.tag-name", "my-tag")
.format("paimon")
.load("path/to/table")
```
-#### SQL
-Requires Spark 3.3+.
-
-you can use `VERSION AS OF` and `TIMESTAMP AS OF` in query to do time travel:
-
-```sql
--- read the snapshot with id 1L (use snapshot id as version)
-SELECT * FROM t VERSION AS OF 1;
-
--- read the snapshot from specified timestamp
-SELECT * FROM t TIMESTAMP AS OF '2023-06-01 00:00:00.123';
-
--- read the snapshot from specified timestamp in unix seconds
-SELECT * FROM t TIMESTAMP AS OF 1678883047;
-
--- read tag 'my-tag'
-SELECT * FROM t VERSION AS OF 'my-tag';
-```
-
{{< /tab >}}
{{< tab "Trino" >}}