Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19498#discussion_r149649246
  
    --- Diff: python/pyspark/streaming/util.py ---
    @@ -64,7 +64,11 @@ def call(self, milliseconds, jrdds):
                 t = datetime.fromtimestamp(milliseconds / 1000.0)
                 r = self.func(t, *rdds)
                 if r:
    -                return r._jrdd
    +                # Here, we work around to ensure `_jrdd` is `JavaRDD` by 
wrapping it by `map`.
    +                # 
org.apache.spark.streaming.api.python.PythonTransformFunction requires to return
    +                # `JavaRDD`; however, this could be `JavaPairRDD` by some 
APIs, for example, `zip`.
    +                # See SPARK-17756.
    +                return r.map(lambda x: x)._jrdd
    --- End diff --
    
    @tdas, it's fine if you feel we should find another way or make a small 
benchmark. I can try. But just wonder which one you'd prefer before I go too 
far in a different way you'd prefer.


---

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

Reply via email to