[ 
https://issues.apache.org/jira/browse/SPARK-11679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15001653#comment-15001653
 ] 

mayuanwen commented on SPARK-11679:
-----------------------------------

The exception is easy to reproduced. I create a java.util.List, and then call 
the method and get the exception. 
The following is the code in java.
       List<StructField> fields = new ArrayList<StructField>();
        fields.add(new StructField("id", DataTypes.StringType, true, 
Metadata.empty()));
        fields.add(new StructField("event", DataTypes.StringType, true, 
Metadata.empty()));
        fields.add(new StructField("name", DataTypes.StringType, true, 
Metadata.empty()));
        fields.add(new StructField("age", DataTypes.IntegerType, true, 
Metadata.empty()));
        StructType schema = StructType$.MODULE$.apply(fields);
I get the same exception using scala.


> When invoking method " apply(fields: java.util.List[StructField])" in 
> "StructType", get exception "java.lang.ClassCastException: 
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SPARK-11679
>                 URL: https://issues.apache.org/jira/browse/SPARK-11679
>             Project: Spark
>          Issue Type: Bug
>    Affects Versions: 1.3.0, 1.3.1, 1.4.0, 1.4.1, 1.5.0, 1.5.1
>            Reporter: mayuanwen
>
> When invoking method " apply(fields: java.util.List[StructField])" in Object 
> "StructType", get exception "java.lang.ClassCastException: 
> [Ljava.lang.Object; cannot be cast to 
> [Lorg.apache.spark.sql.types.StructField; 
> at org.apache.spark.sql.types.StructType$.apply"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to