[ 
https://issues.apache.org/jira/browse/SPARK-57421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sotirios Kougiouris updated SPARK-57421:
----------------------------------------
    Description: 
h2. What

Add the "@" time-travel shorthand on table names so that
{code:sql}
SELECT * FROM name@vN
SELECT * FROM name@<TS>
{code}
and
{code:java}
spark.read.format("delta").table("name@vN")
spark.read.format("delta").table("name@<ts>")
{code}
parse into the same plan as the existing {{VERSION AS OF}} / {{TIMESTAMP AS 
OF}} and {{option("versionAsOf")}} / {{option("timestampAsOf")}} clauses. 
Support for SQL, the classic DataFrame reader, and Spark Connect.
h2. Why

Spark already supports {{VERSION AS OF}} / {{TIMESTAMP AS OF}} and the 
{{{}versionAsOf{}}}/{{{}timestampAsOf{}}} reader options, but not the compact 
"@" suffix. Resolving it at parse time also simplifies the time travel entry 
points pipeline.
h2. Proposed change
 * Lexer/grammar: add @-suffix on table identifiers.
 * AstBuilder converts the suffix into {{RelationTimeTravel}} at parse time.
 * New conf {{spark.sql.timeTravel.atSyntax.enabled}} (default {{true}}) to 
gate it.

h2. Notes
 * Behavior is opt-out via the conf.
 * Backquoted identifiers like {{`name@v1`}} remain literal table names.

  was:
h2. What

Add the "@" time-travel shorthand on table names so that
{code:sql}
SELECT * FROM name@vN
SELECT * FROM name@<TS>
{code}
and
{code:java}
spark.read.format("delta").table("name@vN")
spark.read.format("delta").table("name@<ts>")
{code}
parse into the same plan as the existing {{VERSION AS OF}} / {{TIMESTAMP AS 
OF}} and {{option("versionAsOf")}} / {{option("timestampAsOf")}} clauses. 
Support for SQL, the classic DataFrame reader, and Spark Connect.
h2. Why

Spark already supports {{VERSION AS OF}} / {{TIMESTAMP AS OF}} and the 
{{{}versionAsOf{}}}/{{{}timestampAsOf{}}} reader options, but not the compact 
"@" suffix. Resolving it at parse time also simplifies the time travel entry 
points pipeline.
h2. Proposed change
 * Lexer/grammar: add @-suffix on table identifiers.
 * AstBuilder converts the suffix into {{RelationTimeTravel}} at parse time.
 * New conf {{spark.sql.timeTravel.atSyntax.enabled}} (default true) to gate it.
 * Conflicts (e.g. "@" together with {{AS OF}}) raise error.

h2. Notes
 * Behavior is opt-out via the conf.
 * Backquoted identifiers like {{`name@v1`}} remain literal table names.


> [WIP] Support @-syntax version and timestamp time travel on table name
> ----------------------------------------------------------------------
>
>                 Key: SPARK-57421
>                 URL: https://issues.apache.org/jira/browse/SPARK-57421
>             Project: Spark
>          Issue Type: New Feature
>          Components: Connect, SQL
>    Affects Versions: 5.0.0
>            Reporter: Sotirios Kougiouris
>            Priority: Minor
>              Labels: pull-request-available
>
> h2. What
> Add the "@" time-travel shorthand on table names so that
> {code:sql}
> SELECT * FROM name@vN
> SELECT * FROM name@<TS>
> {code}
> and
> {code:java}
> spark.read.format("delta").table("name@vN")
> spark.read.format("delta").table("name@<ts>")
> {code}
> parse into the same plan as the existing {{VERSION AS OF}} / {{TIMESTAMP AS 
> OF}} and {{option("versionAsOf")}} / {{option("timestampAsOf")}} clauses. 
> Support for SQL, the classic DataFrame reader, and Spark Connect.
> h2. Why
> Spark already supports {{VERSION AS OF}} / {{TIMESTAMP AS OF}} and the 
> {{{}versionAsOf{}}}/{{{}timestampAsOf{}}} reader options, but not the compact 
> "@" suffix. Resolving it at parse time also simplifies the time travel entry 
> points pipeline.
> h2. Proposed change
>  * Lexer/grammar: add @-suffix on table identifiers.
>  * AstBuilder converts the suffix into {{RelationTimeTravel}} at parse time.
>  * New conf {{spark.sql.timeTravel.atSyntax.enabled}} (default {{true}}) to 
> gate it.
> h2. Notes
>  * Behavior is opt-out via the conf.
>  * Backquoted identifiers like {{`name@v1`}} remain literal table names.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to