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

Sean Owen commented on SPARK-9621:
----------------------------------

Hm, I was thinking on it more, and yeah I think there's a good reason the 
second example doesn't return 'true' here in the shell or otherwise. The reason 
is that a plain old class will end up implementing reference equality for == in 
Scala. But a case class doesn't work that way; two different instances of an 
empty case class should be == out of the box. Maybe that's not returning 'true' 
for a different reason, for the original reason I alluded to, that these end up 
not being the same case classes. There I don't know whether it's something 
that's inevitable and by design in Scala, or in Spark, or fixable, but that 
would be a duplicate at least. So maybe there are two causes at work in these 
two examples.

> Closure inside RDD doesn't properly close over environment
> ----------------------------------------------------------
>
>                 Key: SPARK-9621
>                 URL: https://issues.apache.org/jira/browse/SPARK-9621
>             Project: Spark
>          Issue Type: Bug
>    Affects Versions: 1.4.1
>         Environment: Ubuntu 15.04, spark-1.4.1-bin-hadoop2.6 package
>            Reporter: Joe Near
>
> I expect the following:
> case class MyTest(i: Int)
> val tv = MyTest(1)
> val res = sc.parallelize(Array((t: MyTest) => t == tv)).first()(tv)
> to be "true." It is "false," when I type this into spark-shell. It seems the 
> closure is changed somehow when it's serialized and deserialized.



--
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