Skip to content

Commit 795fd15

Browse files
committed
Try to avoid capturing SQLContext.
1 parent e54fb45 commit 795fd15

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

sql/core/src/main/scala/org/apache/spark/sql/UdfRegistration.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,29 @@ protected[sql] trait UdfRegistration {
4040
pythonIncludes: JList[String],
4141
pythonExec: String,
4242
accumulator: Accumulator[JList[Array[Byte]]],
43-
dataType: String): Unit = {
44-
logger.debug(
43+
stringDataType: String): Unit = {
44+
log.debug(
4545
s"""
4646
| Registering new PythonUDF:
4747
| name: $name
4848
| command: ${command.toSeq}
4949
| envVars: $envVars
5050
| pythonIncludes: $pythonIncludes
5151
| pythonExec: $pythonExec
52-
| dataType: $dataType
52+
| dataType: $stringDataType
5353
""".stripMargin)
5454

5555

56+
val dataType = parseDataType(stringDataType)
57+
5658
def builder(e: Seq[Expression]) =
5759
PythonUDF(name,
5860
command,
5961
envVars,
6062
pythonIncludes,
6163
pythonExec,
6264
accumulator,
63-
parseDataType(dataType),
65+
dataType,
6466
e)
6567

6668
functionRegistry.registerFunction(name, builder)

0 commit comments

Comments
 (0)