HyukjinKwon commented on code in PR #41742:
URL: https://github.com/apache/spark/pull/41742#discussion_r1244047093


##########
core/src/main/scala/org/apache/spark/api/r/SerDe.scala:
##########
@@ -404,6 +404,22 @@ private[spark] object SerDe {
             writeKeyValue(dos, k1.asInstanceOf[Object], 
v1.asInstanceOf[Object], jvmObjectTracker)
           }
 
+        // Handle Set - write as list
+        case v: java.util.Set[_] =>
+          writeType(dos, "list")
+          writeInt(dos, v.size)
+          val iter = v.iterator
+          while (iter.hasNext) {
+            val elem = iter.next()
+            writeObject(dos, elem.asInstanceOf[Object], jvmObjectTracker)
+          }
+        case v: scala.collection.Set[_] =>
+          writeType(dos, "list")
+          writeInt(dos, v.size)
+          v.foreach { elem =>
+            writeObject(dos, elem.asInstanceOf[Object], jvmObjectTracker)
+          }

Review Comment:
   @juliuszsompolski I think I would just avoid adding this ser/de here but add 
a method such as  `org.apache.spark.api.r.RUtils.getJobTags(sc: SparkContext): 
Array[String] = sc.getJobTags().toArray`, and invoke this in `context.R`.



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

Reply via email to