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

Maciej Szymkiewicz commented on SPARK-16589:
--------------------------------------------

Not actively so if you want to give it a shot go ahead. 

I investigated a little bit deeper and tried to fix it closer to the sources 
but it ended in a hell full of special cases which makes me think that we 
should never expose data requiring `CartesianDeserializer` directly (there is 
also a SPARK-16589).

> Chained cartesian produces incorrect number of records
> ------------------------------------------------------
>
>                 Key: SPARK-16589
>                 URL: https://issues.apache.org/jira/browse/SPARK-16589
>             Project: Spark
>          Issue Type: Bug
>          Components: PySpark
>    Affects Versions: 1.4.0, 1.5.0, 1.6.0, 2.0.0
>            Reporter: Maciej Szymkiewicz
>
> Chaining cartesian calls in PySpark results in the number of records lower 
> than expected. It can be reproduced as follows:
> {code}
> rdd = sc.parallelize(range(10), 1)
> rdd.cartesian(rdd).cartesian(rdd).count()
> ## 355
> rdd.cartesian(rdd).cartesian(rdd).distinct().count()
> ## 251
> {code}
> It looks like it is related to serialization. If we reserialize after initial 
> cartesian:
> {code}
> rdd.cartesian(rdd)._reserialize(BatchedSerializer(PickleSerializer(), 
> 1)).cartesian(rdd).count()
> ## 1000
> {code}
> or insert identity map:
> {code}
> rdd.cartesian(rdd).map(lambda x: x).cartesian(rdd).count()
> ## 1000
> {code}
> it yields correct results.
>  



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