Skip to content

Commit 8e82f3f

Browse files
committed
remove applyOption
1 parent 174e017 commit 8e82f3f

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,6 @@ object ExpressionEncoder {
6060
ClassTag[T](cls))
6161
}
6262

63-
/**
64-
* Unlike apply(), this method return None instead of throwing exception
65-
* when there's no encoder found for the type `T`. This's mainly used for
66-
* typed Scala UDF to workaround 'Any' type.
67-
*/
68-
def applyOption[T : TypeTag](): Option[ExpressionEncoder[T]] = {
69-
try {
70-
Option(ExpressionEncoder[T]())
71-
} catch {
72-
case _: Exception => None
73-
}
74-
}
75-
7663
// TODO: improve error message for java bean encoder.
7764
def javaBean[T](beanClass: Class[T]): ExpressionEncoder[T] = {
7865
val schema = JavaTypeInference.inferDataType(beanClass)._1

0 commit comments

Comments
 (0)