You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "hililiwei (via GitHub)" <gi...@apache.org> on 2023/07/06 06:18:35 UTC

[GitHub] [incubator-paimon] hililiwei commented on a diff in pull request #1497: [test][doc] Spark time travel with data frame test and doc

hililiwei commented on code in PR #1497:
URL: https://github.com/apache/incubator-paimon/pull/1497#discussion_r1253985046


##########
docs/content/engines/spark3.md:
##########
@@ -205,6 +205,50 @@ dataset.createOrReplaceTempView("my_table")
 spark.sql("SELECT * FROM my_table").show()
 ```
 
+## Time travel
+
+### SQL
+
+Spark 3.3 and later supports time travel in SQL queries using `TIMESTAMP AS OF` or `VERSION AS OF` clauses.
+
+
+```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';
+```
+
+### DataFrame
+
+To select a specific table snapshot or the snapshot at some time in the DataFrame API, Paimon supports:

Review Comment:
   Done.



-- 
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: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org