public class PartitionSpec
extends java.lang.Object
implements java.io.Serializable
Partition data is produced by transforming columns in a table. Each column transform is
represented by a named PartitionField
.
Modifier and Type | Class and Description |
---|---|
static class |
PartitionSpec.Builder
Used to create valid
partition specs . |
Modifier and Type | Method and Description |
---|---|
static PartitionSpec.Builder |
builderFor(Schema schema)
Creates a new
partition spec builder for the given Schema . |
boolean |
compatibleWith(PartitionSpec other)
Returns true if this spec is equivalent to the other, with partition field ids ignored.
|
boolean |
equals(java.lang.Object other) |
java.util.List<PartitionField> |
fields()
Returns the list of
partition fields for this spec. |
java.util.List<PartitionField> |
getFieldsBySourceId(int fieldId)
Returns the
field that partitions the given source field |
int |
hashCode() |
java.util.Set<java.lang.Integer> |
identitySourceIds()
Returns the source field ids for identity partitions.
|
boolean |
isUnpartitioned() |
java.lang.Class<?>[] |
javaClasses() |
java.lang.String |
partitionToPath(StructLike data) |
Types.StructType |
partitionType()
Returns a
Types.StructType for partition data defined by this spec. |
Schema |
schema()
Returns the
Schema for this spec. |
int |
specId()
Returns the ID of this spec.
|
java.lang.String |
toString() |
static PartitionSpec |
unpartitioned()
Returns a spec for unpartitioned tables.
|
public int specId()
public java.util.List<PartitionField> fields()
partition fields
for this spec.public boolean isUnpartitioned()
public java.util.List<PartitionField> getFieldsBySourceId(int fieldId)
field
that partitions the given source fieldfieldId
- a field id from the source schemafield
that partitions the given source fieldpublic Types.StructType partitionType()
Types.StructType
for partition data defined by this spec.public java.lang.Class<?>[] javaClasses()
public java.lang.String partitionToPath(StructLike data)
public boolean compatibleWith(PartitionSpec other)
other
- another PartitionSpecpublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Set<java.lang.Integer> identitySourceIds()
public java.lang.String toString()
toString
in class java.lang.Object
public static PartitionSpec unpartitioned()
public static PartitionSpec.Builder builderFor(Schema schema)
partition spec builder
for the given Schema
.schema
- a schema