Repository: spark Updated Branches: refs/heads/master 0eee06158 -> 97652416e
[SPARK-8750][SQL] Remove the closure in functions.callUdf. Author: Reynold Xin <r...@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. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/97652416 Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/97652416 Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/97652416 Branch: refs/heads/master Commit: 97652416e22ae7d4c471178377a7dda61afb1f7a Parents: 0eee061 Author: Reynold Xin <r...@databricks.com> Authored: Wed Jul 1 01:08:20 2015 -0700 Committer: Reynold Xin <r...@databricks.com> Committed: Wed Jul 1 01:08:20 2015 -0700 ---------------------------------------------------------------------- .../src/main/scala/org/apache/spark/sql/functions.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/97652416/sql/core/src/main/scala/org/apache/spark/sql/functions.scala ---------------------------------------------------------------------- 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 5767668..4e8f3f9 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) } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org