spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <>
Subject [jira] [Commented] (SPARK-25371) Vector Assembler with no input columns leads to opaque error
Date Sun, 09 Sep 2018 13:15:00 GMT


Apache Spark commented on SPARK-25371:

User 'mgaido91' has created a pull request for this issue:

> Vector Assembler with no input columns leads to opaque error
> ------------------------------------------------------------
>                 Key: SPARK-25371
>                 URL:
>             Project: Spark
>          Issue Type: Bug
>          Components: ML, MLlib
>    Affects Versions: 2.3.0, 2.3.1
>            Reporter: Victor Alor
>            Priority: Trivial
> When `VectorAssembler ` is given an empty array as its inputColumns it throws an opaque
error. In versions less than 2.3 `VectorAssembler` it simply appends a column containing empty
> {code:java}
> val inputCols = Array()
> val outputCols = Array("A")
> val vectorAssembler = new VectorAssembler()
> .setInputCols(inputCols)
> .setOutputCol(outputCols)
> {code}
> In versions 2.3 > this throws the exception below
> {code:java}
> org.apache.spark.sql.AnalysisException: cannot resolve 'named_struct()' due to data type
mismatch: input to function named_struct requires at least one argument;;
> {code}
> Whereas in versions less than 2.3 it just adds a column containing an empty vector.
> I'm not certain if this is an intentional choice or an actual bug. If this is a bug,
the `VectorAssembler` should be modified to append an empty vector column if it detects no
> If it is a design decision it would be nice to throw a human readable exception explicitly
stating inputColumns must not be empty. The current error is somewhat opaque.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message