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 64245eb26 [doc]Add doc for Trino time travel query (#2467)
64245eb26 is described below
commit 64245eb26d612eca1877310d4c8392fbad5d18ff
Author: shidayang <[email protected]>
AuthorDate: Mon Dec 11 10:16:14 2023 +0800
[doc]Add doc for Trino time travel query (#2467)
---
docs/content/engines/trino.md | 22 +++++++++++++++++++++-
docs/content/how-to/querying-tables.md | 12 ++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/docs/content/engines/trino.md b/docs/content/engines/trino.md
index 1f684cf9c..adfcf52d6 100644
--- a/docs/content/engines/trino.md
+++ b/docs/content/engines/trino.md
@@ -188,12 +188,32 @@ SELECT * FROM paimon.test_db.orders
```
## Query with Time Traveling
+{{< tabs "time-travel-example" >}}
+{{< tab "version >=368" >}}
+
+```sql
+-- read the snapshot from specified timestamp
+SELECT * FROM t FOR TIMESTAMP AS OF TIMESTAMP '2023-01-01 00:00:00
Asia/Shanghai';
+
+-- read the snapshot with id 1L (use snapshot id as version)
+SELECT * FROM t FOR VERSION AS OF 1;
```
+
+{{< /tab >}}
+
+{{< tab "version < 368" >}}
+
+```sql
+-- read the snapshot from specified timestamp with a long value in unix
milliseconds
SET SESSION paimon.scan_timestamp_millis=1679486589444;
-SELECT * FROM paimon.test_db.orders;
+SELECT * FROM t;
```
+{{< /tab >}}
+
+{{< /tabs >}}
+
## Trino to Paimon type mapping
This section lists all supported type conversion between Trino and Paimon.
diff --git a/docs/content/how-to/querying-tables.md
b/docs/content/how-to/querying-tables.md
index 0c852192b..8fa906431 100644
--- a/docs/content/how-to/querying-tables.md
+++ b/docs/content/how-to/querying-tables.md
@@ -127,6 +127,18 @@ SELECT * FROM t;
{{< /tab >}}
+{{< tab "Trino 368+" >}}
+
+```sql
+-- read the snapshot from specified timestamp
+SELECT * FROM t FOR TIMESTAMP AS OF TIMESTAMP '2023-01-01 00:00:00
Asia/Shanghai';
+
+-- read the snapshot with id 1L (use snapshot id as version)
+SELECT * FROM t FOR VERSION AS OF 1;
+```
+
+{{< /tab >}}
+
{{< tab "Hive" >}}
Hive requires adding the following configuration parameters to the
hive-site.xml file: