Skip to content

Commit 01a51ca

Browse files
committed
fix
1 parent 2245395 commit 01a51ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sql/core/src/main/scala/org/apache/spark/sql/expressions/UserDefinedFunction.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,8 @@ case class UserDefinedFunction protected[sql] (
139139
object UserDefinedFunction {
140140
// This is to keep backward compatibility for this case class.
141141
// TODO: revisit this case class in Spark 3.0, and narrow down the public surface.
142-
def unapply(arg: UserDefinedFunction): Option[(AnyRef, DataType, Option[Seq[DataType]])] = {
143-
Some(arg.f, arg.dataType, arg.inputSchemas.map(_.map(_.dataType)))
142+
def unapply(obj: Any): Option[(AnyRef, DataType, Option[Seq[DataType]])] = obj match {
143+
case udf: UserDefinedFunction =>
144+
Some((udf.f, udf.dataType, udf.inputSchemas.map(_.map(_.dataType))))
144145
}
145146
}

0 commit comments

Comments
 (0)