aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Hao <hao.cheng@intel.com>2014-12-30 11:47:08 -0800
committerMichael Armbrust <michael@databricks.com>2014-12-30 11:47:08 -0800
commit63b84b7d6785a687dd7f4c0e2bb1e348800d30d8 (patch)
tree98b8f5f87de3b8e1825605c66c4a8b0752e0d07e
parent5595eaa74f139fdb6fd8a7bb0ca6ed421ef00ac8 (diff)
downloadspark-63b84b7d6785a687dd7f4c0e2bb1e348800d30d8.tar.gz
spark-63b84b7d6785a687dd7f4c0e2bb1e348800d30d8.tar.bz2
spark-63b84b7d6785a687dd7f4c0e2bb1e348800d30d8.zip
[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 <hao.cheng@intel.com> Closes #3745 from chenghao-intel/generic_udf and squashes the following commits: 622ad03 [Cheng Hao] Remove the unnecessary code change in Generic UDF
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala6
1 files changed, 0 insertions, 6 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala
index 93b6ef9fbc..7d863f9d89 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUdfs.scala
@@ -159,11 +159,6 @@ private[hive] case class HiveGenericUdf(funcWrapper: HiveFunctionWrapper, childr
isUDFDeterministic && returnInspector.isInstanceOf[ConstantObjectInspector]
@transient
- protected def constantReturnValue = unwrap(
- returnInspector.asInstanceOf[ConstantObjectInspector].getWritableConstantValue(),
- returnInspector)
-
- @transient
protected lazy val deferedObjects =
argumentInspectors.map(new DeferredObjectAdapter(_)).toArray[DeferredObject]
@@ -171,7 +166,6 @@ private[hive] case class HiveGenericUdf(funcWrapper: HiveFunctionWrapper, childr
override def eval(input: Row): Any = {
returnInspector // Make sure initialized.
- if(foldable) return constantReturnValue
var i = 0
while (i < children.length) {