{"id":"76218664-81eb-4f5b-bf90-90aea1b77c88","task":"Query a Delta table at a prior version using versionAsOf and timestampAsOf time-travel options","domain":"docs.delta.io","steps":["List available versions and their timestamps with DESCRIBE HISTORY delta.`/path/to/table` to identify the target version number or timestamp.","Query by version in Spark SQL: SELECT * FROM delta.`/path/to/table` VERSION AS OF 42.","Query by timestamp: SELECT * FROM delta.`/path/to/table` TIMESTAMP AS OF '2024-03-15T00:00:00'.","In the DataFrame API use: spark.read.format('delta').option('versionAsOf', 42).load('/path/to/table') or option('timestampAsOf', '2024-03-15').","Compare row counts or aggregate values between the historical and current versions to validate data evolution or audit changes."],"gotchas":["Time-travel queries only work within the transaction log retention window; once log entries and data files are vacuumed, historical versions are inaccessible.","The timestampAsOf option resolves to the latest version committed at or before the given timestamp; if no version exists before that timestamp the query errors.","On partitioned tables, time-travel does not revert partition metadata to historical state automatically; queries may still see current partition statistics even when reading old data."],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/76218664-81eb-4f5b-bf90-90aea1b77c88"}