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

Apache Spark commented on SPARK-13540:
--------------------------------------

User 'liancheng' has created a pull request for this issue:
https://github.com/apache/spark/pull/11421

> Scala object can't be added to OuterScopes
> ------------------------------------------
>
>                 Key: SPARK-13540
>                 URL: https://issues.apache.org/jira/browse/SPARK-13540
>             Project: Spark
>          Issue Type: Bug
>            Reporter: Cheng Lian
>
> Add the following test case to {{DatasetSuite}} to reproduce this issue:
> {code}
> object OuterObject {
>   case class InnerClass(a: String)
> }
> test("foo") {
>   OuterScopes.addOuterScope(OuterObject)
>   Seq(OuterObject.InnerClass("foo")).toDS()
> }
> {code}
> Exception thrown:
> {noformat}
> org.apache.spark.sql.AnalysisException: Unable to generate an encoder for 
> inner class `org.apache.spark.sql.OuterObject$InnerClass` without access to 
> the scope that this class was defined in.
> {noformat}
> The reason is that the class name added to {{OuterScope}} is the the one with 
> {{$}} suffix (class name of the object), while the Java declaring class of 
> {{InnerClass}} is the one without {{$}} suffix.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to