-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[WIP][SPARK-35076][SQL] Parse interval literals as ANSI intervals #32176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
447e17b
Change the parsing method
MaxGekk 8cab0f0
Re-gen sql.out
MaxGekk 0d24c9b
Re-gen sql.out
MaxGekk aa7303b
Fix SparkMetadataOperationSuite
MaxGekk f5e692a
Fix HiveThriftBinaryServerSuite
MaxGekk a408ab9
Fix SparkThriftServerProtocolVersionsSuite
MaxGekk e4a4776
Merge remote-tracking branch 'origin/master' into interval-literals-a…
MaxGekk baafc51
Fix SQLQuerySuite
MaxGekk 142b47e
Fix DataFrameFunctionsSuite
MaxGekk ae83c65
Fix DataSourceV2DataFrameSuite
MaxGekk 7df057c
Fix ExpressionInfoSuite
MaxGekk 39d33c9
Re-gen results for PlanStabilitySuite
MaxGekk 0d45567
Re-gen results for PlanStabilityWithStatsSuite
MaxGekk 4d36071
Fix StreamingJoinSuite
MaxGekk 3024d3e
Fix ExpressionParserSuite
MaxGekk 94a5a98
Fix StreamingJoinHelperSuite
MaxGekk 2cdf813
SQLConf.get -> conf
MaxGekk cd578f0
Fix ExpressionParserSuite
MaxGekk 2e67e6e
Test CalendarInterval in ExpressionParserSuite
MaxGekk 2ecd284
Merge remote-tracking branch 'origin/master' into interval-literals-a…
MaxGekk de06515
Re-gen expected test results
MaxGekk 7668405
Fix other tests
MaxGekk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ import org.antlr.v4.runtime.ParserRuleContext | |
| import org.apache.spark.sql.catalyst.parser.ParseException | ||
| import org.apache.spark.sql.catalyst.parser.SqlBaseParser._ | ||
| import org.apache.spark.sql.catalyst.trees.Origin | ||
| import org.apache.spark.sql.internal.SQLConf | ||
|
|
||
| /** | ||
| * Object for grouping all error messages of the query parsing. | ||
|
|
@@ -367,4 +368,10 @@ object QueryParsingErrors { | |
| new ParseException("LOCAL is supported only with file: scheme", ctx) | ||
| } | ||
|
|
||
| def mixedIntervalError(ctx: IntervalContext): Throwable = { | ||
| new ParseException( | ||
| "Mixing of year-month and day-time fields is not allowed. " + | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does ANSI allow mixing daytime interval with same unit e.g. |
||
| s"Set '${SQLConf.LEGACY_INTERVAL_ENABLED.key}' to true to enable the legacy interval type " + | ||
| "which supports mixed fields.", ctx) | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.