aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorEarthson Lu <Earthson.Lu@gmail.com>2016-02-11 18:31:46 -0800
committerXiangrui Meng <meng@databricks.com>2016-02-11 18:31:46 -0800
commit5f1c359069545e75dfe83757c67a4be80428d342 (patch)
tree09f731a43f4535d6542b975df7ab0f595c9aca70 /mllib
parent8121a4b1cb4d7efa84a5e9e8e16d6656cdb79b85 (diff)
downloadspark-5f1c359069545e75dfe83757c67a4be80428d342.tar.gz
spark-5f1c359069545e75dfe83757c67a4be80428d342.tar.bz2
spark-5f1c359069545e75dfe83757c67a4be80428d342.zip
[SPARK-12746][ML] ArrayType(_, true) should also accept ArrayType(_, false)
https://issues.apache.org/jira/browse/SPARK-12746 Author: Earthson Lu <Earthson.Lu@gmail.com> Closes #10697 from Earthson/SPARK-12746.
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala b/mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala
index d5cb05f29b..a6dfe58e56 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala
@@ -71,7 +71,8 @@ private[feature] trait CountVectorizerParams extends Params with HasInputCol wit
/** Validates and transforms the input schema. */
protected def validateAndTransformSchema(schema: StructType): StructType = {
validateParams()
- SchemaUtils.checkColumnType(schema, $(inputCol), new ArrayType(StringType, true))
+ val typeCandidates = List(new ArrayType(StringType, true), new ArrayType(StringType, false))
+ SchemaUtils.checkColumnTypes(schema, $(inputCol), typeCandidates)
SchemaUtils.appendColumn(schema, $(outputCol), new VectorUDT)
}