Nick Pritchard created SPARK-10573:
--------------------------------------
Summary: 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: [email protected]
For additional commands, e-mail: [email protected]