Skip to content

Commit

Permalink
override equals
Browse files Browse the repository at this point in the history
  • Loading branch information
dilipbiswal committed Jan 8, 2016
1 parent de81c21 commit 7dae8e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ private[hive] object HiveShim {
// for Serialization
def this() = this(null)

override def equals(other: Any): Boolean = other match {
case a: HiveFunctionWrapper =>
functionClassName == a.functionClassName
case _ => false
}

@transient
def deserializeObjectByKryo[T: ClassTag](
kryo: Kryo,
Expand Down
14 changes: 0 additions & 14 deletions sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,6 @@ private[hive] case class HiveGenericUDF(funcWrapper: HiveFunctionWrapper, childr
udfType != null && udfType.deterministic()
}

override def semanticEquals(other: Expression): Boolean = {
val eqClass = other.isInstanceOf[HiveGenericUDF] &&
funcWrapper.functionClassName ==
other.asInstanceOf[HiveGenericUDF].funcWrapper.functionClassName

val isEqual = eqClass &&
children.length == other.asInstanceOf[HiveGenericUDF].children.length &&
children.zip(other.asInstanceOf[HiveGenericUDF].children).forall {
case (e1: Expression, e2: Expression) => e1 semanticEquals e2
case (i1, i2) => i1 == i2
}
isEqual
}

@transient
private lazy val deferedObjects = argumentInspectors.zip(children).map { case (inspect, child) =>
new DeferredObjectAdapter(inspect, child.dataType)
Expand Down

0 comments on commit 7dae8e1

Please sign in to comment.