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

    https://github.com/apache/spark/pull/12836#discussion_r61710477
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/object.scala
 ---
    @@ -120,40 +120,50 @@ case class MapPartitions(
         outputObjAttr: Attribute,
         child: LogicalPlan) extends UnaryNode with ObjectConsumer with 
ObjectProducer
     
    -object MapPartitionsInR {
    +/** Factory for constructing new `MapGroupsR` nodes. */
    +object MapGroupsR {
       def apply(
    -      func: Array[Byte],
    -      packageNames: Array[Byte],
    -      broadcastVars: Array[Broadcast[Object]],
    -      schema: StructType,
    -      encoder: ExpressionEncoder[Row],
    -      child: LogicalPlan): LogicalPlan = {
    -    val deserialized = CatalystSerde.deserialize(child, encoder)
    -    val mapped = MapPartitionsInR(
    -      func,
    -      packageNames,
    -      broadcastVars,
    -      encoder.schema,
    -      schema,
    -      CatalystSerde.generateObjAttrForRow(RowEncoder(schema)),
    -      deserialized)
    -    CatalystSerde.serialize(mapped, RowEncoder(schema))
    +       func: Array[Byte],
    +       packageNames: Array[Byte],
    +       broadcastVars: Array[Broadcast[Object]],
    +       schema: StructType,
    +       encoder: Expression,
    +       keyEncoder: Expression,
    +       rowEncoder: ExpressionEncoder[Row],
    +       groupingAttributes: Seq[Attribute],
    +       dataAttributes: Seq[Attribute],
    +       child: LogicalPlan): LogicalPlan = {
    +
    +     val mapped = MapGroupsR(
    +       func,
    +       packageNames,
    +       broadcastVars,
    +       rowEncoder.schema,
    +       schema,
    +       UnresolvedDeserializer(keyEncoder, groupingAttributes),
    +       UnresolvedDeserializer(encoder, dataAttributes),
    +       groupingAttributes,
    +       dataAttributes,
    +       CatalystSerde.generateObjAttrForRow(RowEncoder(schema)),
    +       child)
    +     CatalystSerde.serialize(mapped, RowEncoder(schema))
       }
     }
     
    -/**
    - * A relation produced by applying a serialized R function `func` to each 
partition of the `child`.
    - *
    - */
    -case class MapPartitionsInR(
    +case class MapGroupsR(
         func: Array[Byte],
         packageNames: Array[Byte],
         broadcastVars: Array[Broadcast[Object]],
         inputSchema: StructType,
         outputSchema: StructType,
    +    keyDeserializer: Expression,
    +    valueDeserializer: Expression,
    +    groupingAttributes: Seq[Attribute],
    +    dataAttributes: Seq[Attribute],
         outputObjAttr: Attribute,
    -    child: LogicalPlan) extends UnaryNode with ObjectConsumer with 
ObjectProducer {
    -  override lazy val schema = outputSchema
    +    child: LogicalPlan) extends UnaryNode with ObjectProducer{
    +
    --- End diff --
    
    remove this extra line


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