cloud-fan commented on code in PR #38104:
URL: https://github.com/apache/spark/pull/38104#discussion_r1008997881
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala:
##########
@@ -286,20 +286,29 @@ private[sql] object QueryExecutionErrors extends
QueryErrorsBase {
summary = "")
}
- def ansiDateTimeError(e: DateTimeException): DateTimeException = {
- val newMessage = s"${e.getMessage}. " +
- s"If necessary set ${SQLConf.ANSI_ENABLED.key} to false to bypass this
error."
- new DateTimeException(newMessage, e.getCause)
+ def ansiDateTimeError(e: Exception): SparkDateTimeException = {
+ new SparkDateTimeException(
+ errorClass = "_LEGACY_ERROR_TEMP_2000",
+ errorSubClass = None,
+ messageParameters = Map(
+ "message" -> e.getMessage,
+ "ansiConfig" -> toSQLConf(SQLConf.ANSI_ENABLED.key)),
+ context = Array.empty,
+ summary = "")
}
- def ansiIllegalArgumentError(message: String): IllegalArgumentException = {
- val newMessage = s"$message. If necessary set ${SQLConf.ANSI_ENABLED.key}
" +
- s"to false to bypass this error."
- new IllegalArgumentException(newMessage)
+ def ansiIllegalArgumentError(message: String): SparkIllegalArgumentException
= {
+ new SparkIllegalArgumentException(
+ errorClass = "_LEGACY_ERROR_TEMP_2001",
+ messageParameters = Map(
+ "message" -> message,
+ "ansiConfig" -> toSQLConf(SQLConf.ANSI_ENABLED.key)))
}
- def ansiIllegalArgumentError(e: IllegalArgumentException):
IllegalArgumentException = {
- ansiIllegalArgumentError(e.getMessage)
+ def ansiIllegalArgumentError(e: Exception): SparkIllegalArgumentException = {
+ new SparkIllegalArgumentException(
+ errorClass = "_LEGACY_ERROR_TEMP_2002",
+ messageParameters = Map("message" -> e.getMessage))
Review Comment:
found a regression here. The previous error message has `If necessary set
${SQLConf.ANSI_ENABLED.key} to false ...` but it's gone now.
@itholic can you create a followup PR to fix it?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]