Github user sun-rui commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12836#discussion_r62603091
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/SparkStrategies.scala ---
    @@ -310,6 +310,10 @@ private[sql] abstract class SparkStrategies extends 
QueryPlanner[SparkPlan] {
           case logical.MapPartitionsInR(f, p, b, is, os, objAttr, child) =>
             execution.MapPartitionsExec(
               execution.r.MapPartitionsRWrapper(f, p, b, is, os), objAttr, 
planLater(child)) :: Nil
    +      case logical.MapGroupsInR(f, p, b, is, os, key, value, grouping, 
data, objAttr,
    +        child) => execution.MapGroupsExec(
    +          execution.r.MapGroupsRWrapper(f, p, b, is, os), key, value, 
grouping,
    --- End diff --
    
    don't use MapGroupsRWrapper, as dapply() does. Because this way, the 
Wrapper function will be called multiple times for a partition, which means R 
worker will be launched multiple times, which hurts performance.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to