Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -2960,6 +2960,12 @@
},
"sqlState" : "42601"
},
"INVALID_PARTITION_VALUE" : {
"message" : [
"Failed to cast value <value> to data type <dataType> for partition column <columnName>. Ensure the value matches the expected data type for this partition column."
],
"sqlState" : "42846"
},
"INVALID_PROPERTY_KEY" : {
"message" : [
"<key> is an invalid property key, please use quotes, e.g. SET <key>=<value>."
Expand Down Expand Up @@ -6954,11 +6960,6 @@
"Unable to clear partition directory <path> prior to writing to it."
]
},
"_LEGACY_ERROR_TEMP_2058" : {
"message" : [
"Failed to cast value `<value>` to `<dataType>` for partition column `<columnName>`."
]
},
"_LEGACY_ERROR_TEMP_2059" : {
"message" : [
"End of stream."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -795,11 +795,11 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
def failedToCastValueToDataTypeForPartitionColumnError(
value: String, dataType: DataType, columnName: String): SparkRuntimeException = {
new SparkRuntimeException(
errorClass = "_LEGACY_ERROR_TEMP_2058",
errorClass = "INVALID_PARTITION_VALUE",
messageParameters = Map(
"value" -> value,
"dataType" -> dataType.toString(),
"columnName" -> columnName))
"value" -> toSQLValue(value),
"dataType" -> toSQLType(dataType),
"columnName" -> toSQLId(columnName)))
}

def endOfStreamError(): Throwable = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class FileIndexSuite extends SharedSparkSession {
exception = intercept[SparkRuntimeException] {
fileIndex.partitionSpec()
},
condition = "_LEGACY_ERROR_TEMP_2058",
parameters = Map("value" -> "foo", "dataType" -> "IntegerType", "columnName" -> "a")
condition = "INVALID_PARTITION_VALUE",
parameters = Map("value" -> "'foo'", "dataType" -> "\"INT\"", "columnName" -> "`a`")
)
}

Expand Down