[SPARK-29961][SQL][FOLLOWUP] Remove useless test for VectorUDT

### What changes were proposed in this pull request?

A follow-up to rm useless test in VectorUDTSuite

### Why are the changes needed?

rm useless test, which is already covered.
### Does this PR introduce any user-facing change?

no

### How was this patch tested?

no

Closes #26620 from yaooqinn/SPARK-29961-f.

Authored-by: Kent Yao <yaooqinn@hotmail.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
This commit is contained in:
Kent Yao 2019-11-20 21:02:22 -08:00 committed by Dongjoon Hyun
parent 74cb1ffd68
commit d555f8fcc9

View file

@ -17,15 +17,12 @@
package org.apache.spark.ml.linalg package org.apache.spark.ml.linalg
import java.util.Arrays import org.apache.spark.SparkFunSuite
import org.apache.spark.ml.feature.LabeledPoint import org.apache.spark.ml.feature.LabeledPoint
import org.apache.spark.sql.{QueryTest, Row}
import org.apache.spark.sql.catalyst.JavaTypeInference import org.apache.spark.sql.catalyst.JavaTypeInference
import org.apache.spark.sql.test.SharedSparkSession
import org.apache.spark.sql.types._ import org.apache.spark.sql.types._
class VectorUDTSuite extends QueryTest with SharedSparkSession { class VectorUDTSuite extends SparkFunSuite {
test("preloaded VectorUDT") { test("preloaded VectorUDT") {
val dv1 = Vectors.dense(Array.empty[Double]) val dv1 = Vectors.dense(Array.empty[Double])
@ -47,11 +44,4 @@ class VectorUDTSuite extends QueryTest with SharedSparkSession {
assert(dataType.asInstanceOf[StructType].fields.map(_.dataType) assert(dataType.asInstanceOf[StructType].fields.map(_.dataType)
=== Seq(new VectorUDT, DoubleType)) === Seq(new VectorUDT, DoubleType))
} }
test("typeof Vector") {
val data = Arrays.asList(Row(Vectors.dense(1.0, 2.0)))
val schema = new StructType().add("v", new VectorUDT)
checkAnswer(spark.createDataFrame(data, schema).selectExpr("typeof(v)"),
Seq(Row("struct<type:tinyint,size:int,indices:array<int>,values:array<double>>")))
}
} }