Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions common/utils/src/main/resources/error/error-conditions.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@
],
"sqlState" : "42000"
},
"ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS" : {
"message" : [
"ANSI mode error: <message>. If necessary set <ansiConfig> to false to bypass this error."
],
"sqlState" : "22008"
},
"ARITHMETIC_OVERFLOW" : {
"message" : [
"<message>.<alternative> If necessary set <config> to \"false\" to bypass this error."
Expand Down Expand Up @@ -6691,11 +6697,6 @@
"Sinks cannot request distribution and ordering in continuous execution mode."
]
},
"_LEGACY_ERROR_TEMP_2000" : {
"message" : [
"<message>. If necessary set <ansiConfig> to false to bypass this error."
]
},
"_LEGACY_ERROR_TEMP_2003" : {
"message" : [
"Unsuccessful try to zip maps with <size> unique keys due to exceeding the array size limit <maxRoundedArrayLength>."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE

def ansiDateTimeError(e: Exception): SparkDateTimeException = {
new SparkDateTimeException(
errorClass = "_LEGACY_ERROR_TEMP_2000",
errorClass = "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
messageParameters = Map(
"message" -> e.getMessage,
"ansiConfig" -> toSQLConf(SQLConf.ANSI_ENABLED.key)),
Expand All @@ -289,7 +289,7 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE

def ansiIllegalArgumentError(message: String): SparkIllegalArgumentException = {
new SparkIllegalArgumentException(
errorClass = "_LEGACY_ERROR_TEMP_2000",
errorClass = "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
messageParameters = Map(
"message" -> message,
"ansiConfig" -> toSQLConf(SQLConf.ANSI_ENABLED.key)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class DateExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
withSQLConf((SQLConf.ANSI_ENABLED.key, "true")) {
checkErrorInExpression[SparkIllegalArgumentException](
DateAddInterval(Literal(d), Literal(new CalendarInterval(1, 1, 25 * MICROS_PER_HOUR))),
"_LEGACY_ERROR_TEMP_2000",
"ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
Map("message" ->
"Cannot add hours, minutes or seconds, milliseconds, microseconds to a date",
"ansiConfig" -> "\"spark.sql.ansi.enabled\""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ class DateTimeUtilsSuite extends SparkFunSuite with Matchers with SQLHelper {
checkError(
exception = intercept[SparkIllegalArgumentException](
dateAddInterval(input, new CalendarInterval(36, 47, 1))),
condition = "_LEGACY_ERROR_TEMP_2000",
condition = "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
parameters = Map(
"message" -> "Cannot add hours, minutes or seconds, milliseconds, microseconds to a date",
"ansiConfig" -> "\"spark.sql.ansi.enabled\""))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for MonthOfYear (valid values 1 - 12): 13"
Expand All @@ -68,7 +68,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for DayOfMonth (valid values 1 - 28/31): 33"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for SecondOfMinute (valid values 0 - 59): 61"
Expand Down Expand Up @@ -185,7 +185,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for SecondOfMinute (valid values 0 - 59): 99"
Expand All @@ -200,7 +200,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for SecondOfMinute (valid values 0 - 59): 999"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid date 'FEBRUARY 30'"
Expand All @@ -702,7 +702,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for MonthOfYear (valid values 1 - 12): 13"
Expand All @@ -717,7 +717,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for DayOfMonth (valid values 1 - 28/31): -1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for SecondOfMinute (valid values 0 - 59): 61"
Expand Down Expand Up @@ -185,7 +185,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for SecondOfMinute (valid values 0 - 59): 99"
Expand All @@ -200,7 +200,7 @@ struct<>
-- !query output
org.apache.spark.SparkDateTimeException
{
"errorClass" : "_LEGACY_ERROR_TEMP_2000",
"errorClass" : "ANSI_DATE_TIME_FIELD_OUT_OF_BOUNDS",
"messageParameters" : {
"ansiConfig" : "\"spark.sql.ansi.enabled\"",
"message" : "Invalid value for SecondOfMinute (valid values 0 - 59): 999"
Expand Down