Github user NarineK commented on a diff in the pull request:
https://github.com/apache/spark/pull/12836#discussion_r62616258
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/r/MapPartitionsRWrapper.scala
---
@@ -25,6 +25,21 @@ import org.apache.spark.sql.Row
import org.apache.spark.sql.types.{BinaryType, StructField, StructType}
/**
+ * A function wrapper that applies the given R function to each partition
of each group.
+ */
+private[sql] case class MapGroupsRWrapper(
--- End diff --
Hi @sun-rui , thank you for the comments.
To be honest, I did give a try the RelationalGroupedDataset and had a
change-set associated with it. However there were certain things which didn't
work well.
In above comment you mentioned:
```
grouped.flatMap { case (key, rowIter) =>
call RRunner.execute()
append the values from the resulting iterator to the buffer
}
```
so, what is the key exactly ? For multiple grouping columns it should be a
list of grouping columns or something similar, shouldn't it ? If so, what kind
of encoder/serializer/deserializer do we want to use for it ?
Also, whenever I tried to call "child.execute().mapPartitionsInternal" it
was throwing an exception saying that the grouping columns weren't included in
the plan. I guess that's the part where they append the grouping columns and
update the plan after it.
Other suggestions are straightforward to do this is the only part I'm not
quite sure.
---
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]