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 2016/02/12 03:31:48 UTC
spark git commit: [SPARK-12746][ML] ArrayType(_,
true) should also accept ArrayType(_, false)
Repository: spark
Updated Branches:
refs/heads/master 8121a4b1c -> 5f1c35906
[SPARK-12746][ML] ArrayType(_, true) should also accept ArrayType(_, false)
https://issues.apache.org/jira/browse/SPARK-12746
Author: Earthson Lu <Ea...@gmail.com>
Closes #10697 from Earthson/SPARK-12746.
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/5f1c3590
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/5f1c3590
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/5f1c3590
Branch: refs/heads/master
Commit: 5f1c359069545e75dfe83757c67a4be80428d342
Parents: 8121a4b
Author: Earthson Lu <Ea...@gmail.com>
Authored: Thu Feb 11 18:31:46 2016 -0800
Committer: Xiangrui Meng <me...@databricks.com>
Committed: Thu Feb 11 18:31:46 2016 -0800
----------------------------------------------------------------------
.../main/scala/org/apache/spark/ml/feature/CountVectorizer.scala | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/5f1c3590/mllib/src/main/scala/org/apache/spark/ml/feature/CountVectorizer.scala
----------------------------------------------------------------------
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 d5cb05f..a6dfe58 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)
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org