You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by me...@apache.org on 2015/07/02 18:59:00 UTC
spark git commit: [SPARK-8647] [MLLIB] Potential issue with constant
hashCode
Repository: spark
Updated Branches:
refs/heads/master 246265f2b -> 99c40cd0d
[SPARK-8647] [MLLIB] Potential issue with constant hashCode
I added the code,
// see [SPARK-8647], this achieves the needed constant hash code without constant no.
override def hashCode(): Int = this.getClass.getName.hashCode()
does getting the constant hash code as per jira
Author: Alok Singh <si...@Aloks-MacBook-Pro.local>
Closes #7146 from aloknsingh/aloknsingh_SPARK-8647 and squashes the following commits:
e58bccf [Alok Singh] [SPARK-8647][MLlib] to avoid the class derivation issues, change the constant hashCode to override def hashCode(): Int = classOf[MatrixUDT].getName.hashCode()
43cdb89 [Alok Singh] [SPARK-8647][MLlib] Potential issue with constant hashCode
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/99c40cd0
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/99c40cd0
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/99c40cd0
Branch: refs/heads/master
Commit: 99c40cd0d8465525cac34dfa373b81532ef3d719
Parents: 246265f
Author: Alok Singh <si...@Aloks-MacBook-Pro.local>
Authored: Thu Jul 2 09:58:57 2015 -0700
Committer: Xiangrui Meng <me...@databricks.com>
Committed: Thu Jul 2 09:58:57 2015 -0700
----------------------------------------------------------------------
mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala | 3 ++-
mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/99c40cd0/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
index 85e63b1..0a61549 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
@@ -193,7 +193,8 @@ private[spark] class MatrixUDT extends UserDefinedType[Matrix] {
}
}
- override def hashCode(): Int = 1994
+ // see [SPARK-8647], this achieves the needed constant hash code without constant no.
+ override def hashCode(): Int = classOf[MatrixUDT].getName.hashCode()
override def typeName: String = "matrix"
http://git-wip-us.apache.org/repos/asf/spark/blob/99c40cd0/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala
index 2ffa497..c9c2742 100644
--- a/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala
+++ b/mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala
@@ -234,7 +234,8 @@ private[spark] class VectorUDT extends UserDefinedType[Vector] {
}
}
- override def hashCode: Int = 7919
+ // see [SPARK-8647], this achieves the needed constant hash code without constant no.
+ override def hashCode(): Int = classOf[VectorUDT].getName.hashCode()
override def typeName: String = "vector"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org