All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sparkutils.shim.expressions.MapGroups.scala Maven / Gradle / Ivy

Go to download

Runtime Shims to ease developing multi version Spark libraries, these should only be used as compiled scope for your target platform or test for OSS when deploying to non-OSS

The newest version!
package com.sparkutils.shim.expressions

import org.apache.spark.sql.Encoder
import org.apache.spark.sql.catalyst.expressions.{Attribute, SortOrder}
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, MapGroups => SMapGroups}

object MapGroups4 {
  def apply[K: Encoder, T: Encoder, U: Encoder](
                                                 func: (K, Iterator[T]) => TraversableOnce[U],
                                                 groupingAttributes: Seq[Attribute],
                                                 dataAttributes: Seq[Attribute],
                                                 child: LogicalPlan
                                               ): LogicalPlan =
    SMapGroups(
      func,
      groupingAttributes,
      dataAttributes,
      Seq(), // #698 - no order given
      child
    )
}

object MapGroups5 {
  def apply[K: Encoder, T: Encoder, U: Encoder](
                                                 func: (K, Iterator[T]) => TraversableOnce[U],
                                                 groupingAttributes: Seq[Attribute],
                                                 dataAttributes: Seq[Attribute],
                                                 dataOrder: Seq[SortOrder],
                                                 child: LogicalPlan
                                               ): LogicalPlan =
    SMapGroups(
      func,
      groupingAttributes,
      dataAttributes,
      dataOrder,
      child
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy