[SPARK-34718][SQL] Assign pretty names to YearMonthIntervalType and DayTimeIntervalType - #31810
Closed
MaxGekk wants to merge 2 commits into
Closed
[SPARK-34718][SQL] Assign pretty names to YearMonthIntervalType and DayTimeIntervalType#31810MaxGekk wants to merge 2 commits into
MaxGekk wants to merge 2 commits into
Conversation
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
yaooqinn
reviewed
Mar 11, 2021
|
|
||
| private[spark] override def asNullable: YearMonthIntervalType = this | ||
|
|
||
| override def typeName: String = "year-month interval" |
Member
There was a problem hiding this comment.
according to the standard,year-month and day-time is italic,so I guess interval here is unnecessary.
Member
Author
There was a problem hiding this comment.
- I haven't found any places in the SQL standard where
year-monthandday-timeare used without theinterval(s)word(s). - Actual type name is
INTERVAL,year-monthandday-timejust define (sub-)classes of the type. - Since the
typeName()method is used in error messages, I do believe we should leaveintervalin type names for readability.
Member
Author
|
@cloud-fan @dongjoon-hyun @HyukjinKwon Could you review this PR, please. |
dongjoon-hyun
approved these changes
Mar 11, 2021
dongjoon-hyun
left a comment
Member
There was a problem hiding this comment.
+1, LGTM. Thank you.
Merged to master.
Contributor
|
late LGTM |
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?
In the PR, I propose to override the

typeName()method inYearMonthIntervalTypeandDayTimeIntervalType, and assign them names according to the ANSI SQL standard:but keep the type name as singular according existing naming convention for other types.
Why are the changes needed?
To improve Spark SQL user experience, and have readable types in error messages.
Does this PR introduce any user-facing change?
Should not since the types has not been released yet.
How was this patch tested?
By running the modified tests: