Skip to content

Commit

Permalink
[SPARK-6308] [MLlib][Sql] VectorUDT is displayed as vecto in dtypes
Browse files Browse the repository at this point in the history
  • Loading branch information
MechCoder committed Mar 21, 2015
1 parent 257cde7 commit b966242
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
Expand Up @@ -187,6 +187,8 @@ private[spark] class MatrixUDT extends UserDefinedType[Matrix] {

override def hashCode(): Int = 1994

override def typeName: String = "matrix"

private[spark] override def asNullable: MatrixUDT = this
}

Expand Down
Expand Up @@ -185,6 +185,8 @@ private[spark] class VectorUDT extends UserDefinedType[Vector] {

override def hashCode: Int = 7919

override def typeName: String = "vector"

private[spark] override def asNullable: VectorUDT = this
}

Expand Down
Expand Up @@ -436,5 +436,6 @@ class MatricesSuite extends FunSuite {
Seq(dm1, dm2, dm3, sm1, sm2, sm3).foreach {
mat => assert(mat.toArray === mUDT.deserialize(mUDT.serialize(mat)).toArray)
}
assert(mUDT.typeName == "matrix")
}
}
Expand Up @@ -187,6 +187,7 @@ class VectorsSuite extends FunSuite {
for (v <- Seq(dv0, dv1, sv0, sv1)) {
assert(v === udt.deserialize(udt.serialize(v)))
}
assert(udt.typeName == "vector")
}

test("fromBreeze") {
Expand Down

0 comments on commit b966242

Please sign in to comment.