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

    https://github.com/apache/spark/pull/2378#discussion_r17574399
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala ---
    @@ -472,214 +452,140 @@ class PythonMLLibAPI extends Serializable {
           numRows: Long,
           numCols: Int,
           numPartitions: java.lang.Integer,
    -      seed: java.lang.Long): JavaRDD[Array[Byte]] = {
    +      seed: java.lang.Long): JavaRDD[Vector] = {
         val parts = getNumPartitionsOrDefault(numPartitions, jsc)
         val s = getSeedOrDefault(seed)
    -    RG.poissonVectorRDD(jsc.sc, mean, numRows, numCols, parts, 
s).map(SerDe.serializeDoubleVector)
    +    RG.poissonVectorRDD(jsc.sc, mean, numRows, numCols, parts, s)
       }
     
     }
     
     /**
    - * :: DeveloperApi ::
    - * MultivariateStatisticalSummary with Vector fields serialized.
    + * SerDe utility functions for PythonMLLibAPI.
      */
    -@DeveloperApi
    -class MultivariateStatisticalSummarySerialized(val summary: 
MultivariateStatisticalSummary)
    -  extends Serializable {
    +private[spark] object SerDe extends Serializable {
     
    -  def mean: Array[Byte] = SerDe.serializeDoubleVector(summary.mean)
    +  private[python] def reduce_object(out: OutputStream, pickler: Pickler,
    +                                    module: String, name: String, objects: 
Object*) = {
    +    out.write(Opcodes.GLOBAL)
    +    out.write((module + "\n" + name + "\n").getBytes)
    --- End diff --
    
    Does it increase the storage cost by a lot for small objects?


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