[ https://issues.apache.org/jira/browse/SPARK-10573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14743958#comment-14743958 ]
Apache Spark commented on SPARK-10573: -------------------------------------- User 'pnpritchard' has created a pull request for this issue: https://github.com/apache/spark/pull/8751 > IndexToString transformSchema adds output field as DoubleType > ------------------------------------------------------------- > > Key: SPARK-10573 > URL: https://issues.apache.org/jira/browse/SPARK-10573 > Project: Spark > Issue Type: Bug > Components: ML > Affects Versions: 1.5.0 > Reporter: Nick Pritchard > > Reproducible example: > {code} > val stage = new IndexToString().setInputCol("input").setOutputCol("output") > val inSchema = StructType(Seq(StructField("input", DoubleType))) > val outSchema = stage.transformSchema(inSchema) > assert(outSchema("output").dataType == StringType) > {code} > The root cause seems to be that it uses {{NominalAttribute.toStructField}} > which assumes {{DoubleType}}. It would probably be better to just use > {{SchemaUtils.appendColumn}} and explicitly set the data type. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org