Skip to content

Commit 63b84b7

Browse files
chenghao-intelmarmbrus
authored andcommitted
[SPARK-4904] [SQL] Remove the unnecessary code change in Generic UDF
Since #3429 has been merged, the bug of wrapping to Writable for HiveGenericUDF is resolved, we can safely remove the foldable checking in `HiveGenericUdf.eval`, which discussed in #2802. Author: Cheng Hao <[email protected]> Closes #3745 from chenghao-intel/generic_udf and squashes the following commits: 622ad03 [Cheng Hao] Remove the unnecessary code change in Generic UDF
1 parent 5595eaa commit 63b84b7

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ private[hive] case class HiveGenericUdf(funcWrapper: HiveFunctionWrapper, childr
158158
override def foldable =
159159
isUDFDeterministic && returnInspector.isInstanceOf[ConstantObjectInspector]
160160

161-
@transient
162-
protected def constantReturnValue = unwrap(
163-
returnInspector.asInstanceOf[ConstantObjectInspector].getWritableConstantValue(),
164-
returnInspector)
165-
166161
@transient
167162
protected lazy val deferedObjects =
168163
argumentInspectors.map(new DeferredObjectAdapter(_)).toArray[DeferredObject]
@@ -171,7 +166,6 @@ private[hive] case class HiveGenericUdf(funcWrapper: HiveFunctionWrapper, childr
171166

172167
override def eval(input: Row): Any = {
173168
returnInspector // Make sure initialized.
174-
if(foldable) return constantReturnValue
175169

176170
var i = 0
177171
while (i < children.length) {

0 commit comments

Comments
 (0)