diff options
author | Reynold Xin <rxin@databricks.com> | 2015-07-01 01:08:20 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2015-07-01 01:08:20 -0700 |
commit | 97652416e22ae7d4c471178377a7dda61afb1f7a (patch) | |
tree | afef9ef24dfa9a9394b036ccacd5309de6b155f4 /sql/core/src | |
parent | 0eee0615894cda8ae1b2c8e61b8bda0ff648a219 (diff) | |
download | spark-97652416e22ae7d4c471178377a7dda61afb1f7a.tar.gz spark-97652416e22ae7d4c471178377a7dda61afb1f7a.tar.bz2 spark-97652416e22ae7d4c471178377a7dda61afb1f7a.zip |
[SPARK-8750][SQL] Remove the closure in functions.callUdf.
Author: Reynold Xin <rxin@databricks.com>
Closes #7148 from rxin/calludf-closure and squashes the following commits:
00df372 [Reynold Xin] Fixed index out of bound exception.
4beba76 [Reynold Xin] [SPARK-8750][SQL] Remove the closure in functions.callUdf.
Diffstat (limited to 'sql/core/src')
-rw-r--r-- | sql/core/src/main/scala/org/apache/spark/sql/functions.scala | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala index 5767668dd3..4e8f3f96bf 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/functions.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/functions.scala @@ -1829,7 +1829,15 @@ object functions { */ @deprecated("Use callUDF", "1.5.0") def callUdf(udfName: String, cols: Column*): Column = { - UnresolvedFunction(udfName, cols.map(_.expr)) + // Note: we avoid using closures here because on file systems that are case-insensitive, the + // compiled class file for the closure here will conflict with the one in callUDF (upper case). + val exprs = new Array[Expression](cols.size) + var i = 0 + while (i < cols.size) { + exprs(i) = cols(i).expr + i += 1 + } + UnresolvedFunction(udfName, exprs) } } |