Class PartitionSpec

  • All Implemented Interfaces:

    public class PartitionSpec
    extends java.lang.Object
    Represents how to produce partition data for a table.

    Partition data is produced by transforming columns in a table. Each column transform is represented by a named PartitionField.

    See Also:
    Serialized Form
    • Method Detail

      • schema

        public Schema schema()
        Returns the Schema for this spec.
      • specId

        public int specId()
        Returns the ID of this spec.
      • isUnpartitioned

        public boolean isUnpartitioned()
      • getFieldsBySourceId

        public java.util.List<PartitionField> getFieldsBySourceId​(int fieldId)
        Returns the field that partitions the given source field
        fieldId - a field id from the source schema
        the field that partitions the given source field
      • javaClasses

        public java.lang.Class<?>[] javaClasses()
      • partitionToPath

        public java.lang.String partitionToPath​(StructLike data)
      • compatibleWith

        public boolean compatibleWith​(PartitionSpec other)
        Returns true if this spec is equivalent to the other, with partition field ids ignored. That is, if both specs have the same number of fields, field order, field name, source columns, and transforms.
        other - another PartitionSpec
        true if the specs have the same fields, source columns, and transforms.
      • equals

        public boolean equals​(java.lang.Object other)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • identitySourceIds

        public java.util.Set<java.lang.Integer> identitySourceIds()
        Returns the source field ids for identity partitions.
        a set of source ids for the identity partitions.
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • unpartitioned

        public static PartitionSpec unpartitioned()
        Returns a spec for unpartitioned tables.
        a partition spec with no partitions