Github user davies commented on the pull request:

    https://github.com/apache/spark/pull/10550#issuecomment-168753546
  
    @jegonzal Thanks for working on this, could you create a JIRA to track it?
    
    Given the fact that Python is much slower than Scala/Java, I want to 
suggest another approach for zipPartition() for Python, dump the two partitions 
into disk then read back in Python, it will looks like this:
    
    ```
    def zipPartitions(f, *rdds):
         jzipped = dumpPartitionsIntoDisk([rdd._jrdd for rdd in rdds]):
         # each partition of zipped is a list of path of dumped files
         zipped = RDD(jzipped, UTF8Serializer())
         def readPartition(iter):
              paths = list(iter):
              iters = [rdds[i]._deserializer.load_stream(open(p, ‘rb’))   
for i, p in enumerate(paths)]
              return f(*iters)
         return zipped.mapPartition(readPartition)
    ```
    
    `dumpPartitionsIntoDisk` should be implemented in Java/Scala, zip all the 
Java RDD together, then dump each stream within a partition into a file in 
disk, return the paths.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to