[
https://issues.apache.org/jira/browse/SPARK-8527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15556567#comment-15556567
]
Xiao Li commented on SPARK-8527:
--------------------------------
This should have been resolved. Could you retry it in the master branch. If you
still hit it, please reopen it. Thanks!
> StructType's Factory method does not work in java code
> ------------------------------------------------------
>
> Key: SPARK-8527
> URL: https://issues.apache.org/jira/browse/SPARK-8527
> Project: Spark
> Issue Type: Bug
> Components: SQL
> Affects Versions: 1.4.0
> Reporter: Hao Ren
>
> According to the following line of code below:
> https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/types/StructType.scala#L209
> The casting should be successful, however after type erasure, I encounter
> {{java.lang.ClassCastException}}:
> {code}
> ArrayList<StructField> structFields = new ArrayList<>();
> // Some add operation
> return StructType$.MODULE$.apply(structFields); // run time error
> Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object;
> cannot be cast to [Lorg.apache.spark.sql.types.StructField;
> at org.apache.spark.sql.types.StructType$.apply(StructType.scala:209)
> {code}
> Am I missing anything ?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]