srowen commented on a change in pull request #28291:
URL: https://github.com/apache/spark/pull/28291#discussion_r414217548



##########
File path: 
mllib/src/test/scala/org/apache/spark/mllib/util/TestingUtilsSuite.scala
##########
@@ -457,4 +460,19 @@ class TestingUtilsSuite extends SparkFunSuite {
     assert(Matrices.sparse(2, 2, Array(0, 1, 2), Array(0, 1), Array(3.1, 3.5)) 
!~=
       Matrices.dense(0, 0, Array()) relTol 0.01)
   }
+
+  test("SPARK-31400, catalogString distinguish Vectors in ml and mllib") {
+    val schema = StructType(Array[StructField] {
+      StructField("features", new org.apache.spark.mllib.linalg.VectorUDT)
+    })
+    val e = intercept[IllegalArgumentException] {
+      SchemaUtils.checkColumnType(schema, "features", new VectorUDT)
+    }
+    assert(e.getMessage.contains("must be of type"), "class is not same")

Review comment:
       ? I'm suggesting that the test should test this, if you're bothering to 
add it. The point of your change is to express the required and actual type in 
the error message, so the test should check whether at least one of those class 
names is present.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to