You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2015/09/14 20:17:45 UTC

[jira] [Assigned] (SPARK-10573) IndexToString transformSchema adds output field as DoubleType

     [ https://issues.apache.org/jira/browse/SPARK-10573?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Apache Spark reassigned SPARK-10573:
------------------------------------

    Assignee: Apache Spark

> 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
>            Assignee: Apache Spark
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org