djcelis opened a new issue, #7000: URL: https://github.com/apache/iceberg/issues/7000
Hello, In https://iceberg.apache.org/docs/latest/spark-queries/#time-travel the documentation states that the keywords `TIMESTAMP AS OF`, `VERSION AS OF`, `FOR SYSTEM_TIME AS OF` and `FOR SYSTEM_VERSION AS OF` are supported for Spark 3.3 and later. However, after checking the tests, we also learnt the following "undocumented" SQL syntax works in Spark 3.1 and 3.2: ``` String prefix = "snapshot_id_"; // read the table at the snapshot List<Object[]> actual = sql("SELECT * FROM %s.%s", tableName, prefix + snapshotId); ``` https://github.com/apache/iceberg/blob/ce0d075e4014743cb80dac774c3804ff8051070a/spark/v3.1/spark/src/test/java/org/apache/iceberg/spark/sql/TestSelect.java#L153 https://github.com/apache/iceberg/blob/ce0d075e4014743cb80dac774c3804ff8051070a/spark/v3.2/spark/src/test/java/org/apache/iceberg/spark/sql/TestSelect.java#L155 We tested the syntax and it works fine as `SELECT * FROM <your-db>.<your-table>.snapshot_id.<desired-snapshot-id> ` and it would be great to have it documented as a supported way/alternative for those using SQL in Spark 3.1 and 3.2 -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
