diff --git a/common/utils/src/main/resources/error/error-conditions.json b/common/utils/src/main/resources/error/error-conditions.json index 5b08a31a05e44..06dffafb5d8e3 100644 --- a/common/utils/src/main/resources/error/error-conditions.json +++ b/common/utils/src/main/resources/error/error-conditions.json @@ -1155,7 +1155,7 @@ }, "DATETIME_FIELD_OUT_OF_BOUNDS" : { "message" : [ - ". If necessary set to \"false\" to bypass this error." + ". To resolve this, validate your input values and ensure they fall within the acceptable range." ], "sqlState" : "22023" }, diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala index f9f9b31a25aad..48463305256c2 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryExecutionErrors.scala @@ -280,8 +280,7 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE new SparkDateTimeException( errorClass = "DATETIME_FIELD_OUT_OF_BOUNDS", messageParameters = Map( - "rangeMessage" -> e.getMessage, - "ansiConfig" -> toSQLConf(SQLConf.ANSI_ENABLED.key)), + "rangeMessage" -> e.getMessage), context = Array.empty, summary = "") } diff --git a/sql/core/src/test/resources/sql-tests/results/date.sql.out b/sql/core/src/test/resources/sql-tests/results/date.sql.out index 37cf05c6386d7..d628a3a529b91 100644 --- a/sql/core/src/test/resources/sql-tests/results/date.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/date.sql.out @@ -56,7 +56,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for MonthOfYear (valid values 1 - 12): 13" } } @@ -72,7 +71,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for DayOfMonth (valid values 1 - 28/31): 33" } } diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out index feae373b52ca7..f4c7a2f32a38c 100644 --- a/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out @@ -56,7 +56,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for MonthOfYear (valid values 1 - 12): 13" } } @@ -72,7 +71,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for DayOfMonth (valid values 1 - 28/31): 33" } } @@ -1347,7 +1345,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 61" } } @@ -1379,7 +1376,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 99" } } @@ -1395,7 +1391,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 999" } } diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out index d9f4301dd0e8d..2e5122d503009 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out @@ -690,7 +690,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid date 'FEBRUARY 30'" } } @@ -706,7 +705,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for MonthOfYear (valid values 1 - 12): 13" } } @@ -722,7 +720,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for DayOfMonth (valid values 1 - 28/31): -1" } } diff --git a/sql/core/src/test/resources/sql-tests/results/timestamp.sql.out b/sql/core/src/test/resources/sql-tests/results/timestamp.sql.out index 06a8fbad8a29c..2db7052f443f1 100644 --- a/sql/core/src/test/resources/sql-tests/results/timestamp.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/timestamp.sql.out @@ -157,7 +157,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 61" } } @@ -189,7 +188,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 99" } } @@ -205,7 +203,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 999" } } diff --git a/sql/core/src/test/resources/sql-tests/results/timestampNTZ/timestamp-ansi.sql.out b/sql/core/src/test/resources/sql-tests/results/timestampNTZ/timestamp-ansi.sql.out index 933982f5cff6a..3aa19bd876f6a 100644 --- a/sql/core/src/test/resources/sql-tests/results/timestampNTZ/timestamp-ansi.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/timestampNTZ/timestamp-ansi.sql.out @@ -157,7 +157,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 61" } } @@ -189,7 +188,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 99" } } @@ -205,7 +203,6 @@ org.apache.spark.SparkDateTimeException "errorClass" : "DATETIME_FIELD_OUT_OF_BOUNDS", "sqlState" : "22023", "messageParameters" : { - "ansiConfig" : "\"spark.sql.ansi.enabled\"", "rangeMessage" : "Invalid value for SecondOfMinute (valid values 0 - 59): 999" } }