[WIP][SPARK-57421][SQL][CONNECT] Support @-syntax timestamp time travel on table names#56847
Open
sotikoug83 wants to merge 4 commits into
Open
[WIP][SPARK-57421][SQL][CONNECT] Support @-syntax timestamp time travel on table names#56847sotikoug83 wants to merge 4 commits into
sotikoug83 wants to merge 4 commits into
Conversation
…me travel on table names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Add the
@time travel shorthand on table names so thatand
parse into the same plan as the existing
VERSION AS OF/TIMESTAMP AS OFandoption("versionAsOf")/option("timestampAsOf")clauses. Support for SQL, the DataFrame reader, and Spark Connect.Why are the changes needed?
Spark has SQL
AS OFand theversionAsOf/timestampAsOfreader options but not the compact@suffix. Resolving it at parse time also simplifies the time travel entry points pipeline.Does this PR introduce any user-facing change?
Yes, new syntax on table names gated by a
conf(spark.sql.timeTravel.atSyntax.enabled) which allows time travel, default true. No longer gives a parse error when enabled and the syntax is used. Additionally, different fromTIMESTAMP AS OF <TS>(which allows for arbitrary expressions in<TS>), the@<ts>timestamp only accepts the fixed 17-digityyyyMMddHHmmssSSSDelta convention.How was this patch tested?
New tests in
PlanParserSuite,DataSourceV2SQLSuite, andSparkConnectPlannerSuite.Was this patch authored or co-authored using generative AI tooling?
With help from Claude :)