-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-49768][SQL] Provide error conditions for make_date/make_timestamp errors _LEGACY_ERROR_TEMP_2000
#48242
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
Changes from 1 commit
e25bfda
a7d8b7e
fe025ab
57213c3
c8cb363
b71e185
27fea85
5bf98fe
260145e
3ea12a4
72f7834
60fb678
83dd8e7
5ec18e8
7a31955
6d96a85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -298,6 +298,14 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE | |
| (unit, formattedRange, badValue) | ||
| case datePattern(badDate) => | ||
| ("DAY", "1 ... 28/31", badDate) | ||
| case _ => | ||
| throw new SparkDateTimeException( | ||
|
Contributor
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. @srielau @gengliangwang let's link issues to the proper tickets and not open duplicate tickets. The reason for not having a error condition is that |
||
| errorClass = "_LEGACY_ERROR_TEMP_2000", | ||
| messageParameters = Map( | ||
| "message" -> errorMessage, | ||
| "ansiConfig" -> toSQLConf(SQLConf.ANSI_ENABLED.key)), | ||
| context = Array.empty, | ||
| summary = "") | ||
| } | ||
|
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. @itholic Do you expect that it should match to both the cases above. What if not? I would add a default case.
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. For example, How does your code handles this?
Contributor
Author
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. Good point. I think We may need introduce several new error classes to cover the all potential exception cases along with more test cases in a separate ticket. |
||
| } | ||
| val (unit, range, badValue) = extractDateTimeErrorInfo(e) | ||
|
|
||
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.
This is really weird message now. The error we are getting here now is totally relentless of leap years. Java library returns special case errors when we have leap years, look at
LocalDate.create.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.
To clarify, I find it weird that we are removing extra information which java is giving us for free.