Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc : Document time travel via SPARK SQL #4707

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/spark/spark-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,19 @@ ignored. Do not use `table` when attempting to time-travel or use other options.
in [Spark 3.1 - SPARK-32592](https://issues.apache.org/jira/browse/SPARK-32592).
{{< /hint >}}

Time travel is not yet supported by Spark's SQL syntax.
Time travel is not yet fully supported by Spark's SQL syntax. (ref : [Spark 3.3 - SPARK-37219](https://issues.apache.org/jira/browse/SPARK-37219)
for `AS OF` syntax support)

As an alternative we can use `at_timestamp_`, `snapshot_id_` as prefix of timestamp, snapshot_id respectively along with
the table name to time travel.

```sql
-- time travel to October 26, 1986 at 01:21:00
SELECT * FROM prod.db.table.at_timestamp_499162860000;

-- time travel to snapshot with ID 10963874102873L
SELECT * FROM prod.db.table.snapshot_id_10963874102873;
```

### Incremental read

Expand Down