BEFORE syntax support for presto engine.#22631
Merged
gupteaj merged 1 commit intoprestodb:masterfrom May 14, 2024
Merged
Conversation
|
Codenotify: Notifying subscribers in CODENOTIFY files for diff 12a6e44...153bc1f.
|
vivek-bharathan
requested changes
May 3, 2024
Contributor
vivek-bharathan
left a comment
There was a problem hiding this comment.
Please include parser/formatter tests in TestSqlParser and TestStatementBuilder
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Outdated
Show resolved
Hide resolved
presto-parser/src/main/java/com/facebook/presto/sql/ExpressionFormatter.java
Outdated
Show resolved
Hide resolved
hantangwangd
reviewed
May 6, 2024
Member
hantangwangd
left a comment
There was a problem hiding this comment.
Overall looks good to me. Only some little nits.
presto-parser/src/main/java/com/facebook/presto/sql/tree/TableVersionExpression.java
Show resolved
Hide resolved
presto-parser/src/main/java/com/facebook/presto/sql/tree/TableVersionExpression.java
Outdated
Show resolved
Hide resolved
presto-main/src/main/java/com/facebook/presto/sql/analyzer/StatementAnalyzer.java
Show resolved
Hide resolved
hantangwangd
approved these changes
May 6, 2024
Member
hantangwangd
left a comment
There was a problem hiding this comment.
LGTM. Thanks for the fix.
tdcmeehan
approved these changes
May 14, 2024
Member
|
Hey @gupteaj , this change has broken a bunch of tests. Do we need to upgrade the antlr version? |
Contributor
|
@zacw7 can you add a link to a test run? |
Member
They are meta internal tests. Let me check the build tool. |
Contributor
|
I suspect that the Meta build tool chain needs to recompile the parser module more aggressively. This is the second such instance I have seen in recent times |
36 tasks
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.
Description
Presto issue #21971
Note - This PR has BEFORE syntax and engine side changes. For iceberg connector changes, test and doc, a new PR will be created.
Design description :
This feature will allow iceberg connector to query historical data using BEFORE syntax on a table.
Time travel version option will read bigint snapshot id value for the table. Time travel timestamp option will read
timestamp-with-time-zone value for the table.
examples
Parser, Semantic Analyzer, Metadata
In parser tree, update TableVersionExpression class to hold time travel operator ( EQUAL/LESS_THAN) for AS OF/BEFORE state
Motivation and Context
Snowflake provides a BEFORE clause for time travel queries. When used in a query, this clause is specified in the FROM clause immediately after the table name. It determines the point in the past from which historical data is requested for the object. The AT keyword includes changes made by a statement or transaction with a timestamp equal to the specified parameter, while the BEFORE keyword refers to a point immediately preceding the specified parameter.
IBM Netezza supports BEFORE clause similar to Snowflake.
References -
Snowflake - https://docs.snowflake.com/en/sql-reference/constructs/at-before
IBM Netezza - https://cloud.ibm.com/docs/netezza?topic=netezza-runningqueries_tt#before_tt
Impact
A new table level option to return specific snapshot for iceberg connector
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
Note - Iceberg PR will have release notes and doc section