Class Partitions

java.lang.Object
org.apache.gravitino.rel.partitions.Partitions

public class Partitions extends Object
The helper class for partition expressions.
  • Field Details

    • EMPTY_PARTITIONS

      public static Partition[] EMPTY_PARTITIONS
      An empty array of partitions.
  • Method Details

    • range

      public static RangePartition range(String name, Literal<?> upper, Literal<?> lower, Map<String,String> properties)
      Creates a range partition.
      Parameters:
      name - The name of the partition.
      upper - The upper bound of the partition.
      lower - The lower bound of the partition.
      properties - The properties of the partition.
      Returns:
      The created partition.
    • list

      public static ListPartition list(String name, Literal<?>[][] lists, Map<String,String> properties)
      Creates a list partition.
      Parameters:
      name - The name of the partition.
      lists - The values of the list partition.
      properties - The properties of the partition.
      Returns:
      The created partition.
    • identity

      public static IdentityPartition identity(String name, String[][] fieldNames, Literal<?>[] values, Map<String,String> properties)
      Creates an identity partition.

      The values must correspond to the fieldNames.

      Parameters:
      name - The name of the partition.
      fieldNames - The field names of the identity partition.
      values - The value of the identity partition.
      properties - The properties of the partition.
      Returns:
      The created partition.
    • identity

      public static IdentityPartition identity(String[][] fieldNames, Literal<?>[] values)
      Creates an identity partition whose name will be automatically generated.
      Parameters:
      fieldNames - The field names of the identity partition.
      values - The values of the identity partition.
      Returns:
      The created partition.