-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-34718][SQL] Assign pretty names to YearMonthIntervalType and DayTimeIntervalType #31810
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
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): |
|
|
||
| private[spark] override def asNullable: YearMonthIntervalType = this | ||
|
|
||
| override def typeName: String = "year-month interval" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to the standard,year-month and day-time is italic,so I guess interval here is unnecessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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.
|
@cloud-fan @dongjoon-hyun @HyukjinKwon Could you review this PR, please. |
dongjoon-hyun
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, LGTM. Thank you.
Merged to master.
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM2
|
late LGTM |
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: