Class KeyGroupedPartitioning

All Implemented Interfaces:

@Evolving public class KeyGroupedPartitioning extends Object implements Partitioning
Represents a partitioning where rows are split across partitions based on the partition transform expressions returned by keys.

Note: Data source implementations should make sure for a single partition, all of its rows must be evaluated to the same partition value after being applied by keys expressions. Different partitions can share the same partition value: Spark will group these into a single logical partition during planning phase.

  • Constructor Details

    • KeyGroupedPartitioning

      public KeyGroupedPartitioning(Expression[] keys, int numPartitions)
  • Method Details

    • keys

      public Expression[] keys()
      Returns the partition transform expressions for this partitioning.
    • numPartitions

      public int numPartitions()
      Description copied from interface: Partitioning
      Returns the number of partitions that the data is split across.
      Specified by:
      numPartitions in interface Partitioning