zshao9 commented on code in PR #46697:
URL: https://github.com/apache/spark/pull/46697#discussion_r1612223970
##########
core/src/test/scala/org/apache/spark/api/python/SerDeUtilSuite.scala:
##########
@@ -32,5 +32,22 @@ class SerDeUtilSuite extends SparkFunSuite with
SharedSparkContext {
val pythonRdd = SerDeUtil.javaToPython(javaRdd)
SerDeUtil.pythonToPairRDD(pythonRdd, false)
}
+
+ test("Converting JavaRDD to PythonRDD with a fixed batch size of 1
(SPARK-48380)") {
+ val rddWith3Elements = sc.makeRDD(Seq[(Any, Any)]((1, 2), (3, 4), (5, 6)))
+ val javaRdd = rddWith3Elements.toJavaRDD()
+ val pythonRdd = SerDeUtil.javaToPython(javaRdd, 1)
+ val collected = pythonRdd.collect()
+ assert(collected.size() === 3)
+ }
+
+ test("Converting JavaRDD to PythonRDD with an auto batch size
(SPARK-48380)") {
+ val rddWith3Elements = sc.makeRDD(Seq[(Any, Any)]((1, 2), (3, 4), (5, 6)))
+ val javaRdd = rddWith3Elements.toJavaRDD()
+ val pythonRdd = SerDeUtil.javaToPython(javaRdd)
+ val collected = pythonRdd.collect()
+ assert(collected.size() === 2)
Review Comment:
This is actually failing. Need to find a way to verify that
AutoBatchedPickler did batch rows together.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]