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

    https://github.com/apache/spark/pull/12057#discussion_r58103468
  
    --- Diff: core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala 
---
    @@ -78,21 +78,41 @@ private[spark] case class PythonFunction(
         accumulator: Accumulator[JList[Array[Byte]]])
     
     /**
    - * A helper class to run Python UDFs in Spark.
    + * A wrapper for chained Python functions (from bottom to top).
    + * @param funcs
    + */
    +private[spark] case class ChainedPythonFunctions(funcs: 
Seq[PythonFunction])
    +
    +private[spark] object PythonRunner {
    +  def apply(func: PythonFunction, bufferSize: Int, reuse_worker: Boolean): 
PythonRunner = {
    +    new PythonRunner(
    +      Seq(ChainedPythonFunctions(Seq(func))), bufferSize, reuse_worker, 
false, Array(Array(0)))
    +  }
    +}
    +
    +/**
    + * A helper class to run Python mapPartition/UDFs in Spark.
    + *
    + * funcs is a list of independent Python functions, each one of them is a 
list of chained Python
    + * functions (from bottom to top).
      */
     private[spark] class PythonRunner(
    -    funcs: Seq[PythonFunction],
    +    funcs: Seq[ChainedPythonFunctions],
         bufferSize: Int,
         reuse_worker: Boolean,
    -    rowBased: Boolean)
    +    isUDF: Boolean,
    +    argOffsets: Array[Array[Int]])
       extends Logging {
     
    +  require(funcs.length == argOffsets.length, "numArgs should have the same 
length as funcs")
    --- End diff --
    
    numArgs -> argOffsets


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