Skip to content
Open
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 @@ -7004,6 +7004,12 @@
],
"sqlState" : "42803"
},
"UNRESOLVED_COLLECTION_CLS" : {
"message" : [
"Custom collection class is not resolved. Ensure the class is accessible and properly defined before analysis."
],
"sqlState" : "0A000"
},
"UNRESOLVED_COLUMN" : {
"message" : [
"A column, variable, or function parameter with name <objectName> cannot be resolved."
Expand Down Expand Up @@ -9276,11 +9282,6 @@
"Unsuccessful try to zip maps with <size> unique keys due to exceeding the array size limit <maxRoundedArrayLength>."
]
},
"_LEGACY_ERROR_TEMP_2017" : {
"message" : [
"not resolved."
]
},
"_LEGACY_ERROR_TEMP_2026" : {
"message" : [
"Failed to convert value <value> (class of <cls>) with the type of <dataType> to JSON."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,9 @@ private[sql] object QueryExecutionErrors extends QueryErrorsBase with ExecutionE
}

def customCollectionClsNotResolvedError(): SparkUnsupportedOperationException = {
new SparkUnsupportedOperationException("_LEGACY_ERROR_TEMP_2017")
new SparkUnsupportedOperationException(
errorClass = "UNRESOLVED_COLLECTION_CLS",
messageParameters = Map.empty[String, String])
}

def classUnsupportedByMapObjectsError(cls: Class[_]): SparkRuntimeException = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import scala.reflect.ClassTag
import scala.reflect.runtime.universe.TypeTag
import scala.util.Random

import org.apache.spark.{SparkConf, SparkException, SparkFunSuite, SparkRuntimeException}
import org.apache.spark.{SparkConf, SparkException, SparkFunSuite, SparkRuntimeException, SparkUnsupportedOperationException}
import org.apache.spark.serializer.{JavaSerializer, KryoSerializer}
import org.apache.spark.sql.{RandomDataGenerator, Row}
import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow, ScalaReflection, ScroogeLikeExample}
Expand Down Expand Up @@ -106,6 +106,17 @@ class ObjectExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper {
)
}

test("SPARK-43253: UNRESOLVED_COLLECTION_CLS error class") {
checkError(
exception = intercept[SparkUnsupportedOperationException] {
val unresolved = UnresolvedMapObjects(identity, Literal(1), None)
unresolved.dataType
},
condition = "UNRESOLVED_COLLECTION_CLS",
parameters = Map.empty
)
}

test("MapObjects should make copies of unsafe-backed data") {
// test UnsafeRow-backed data
val structEncoder = ExpressionEncoder[Array[Tuple2[java.lang.Integer, java.lang.Integer]]]()
Expand Down