Package org.apache.iceberg
Class PartitionSpec
java.lang.Object
org.apache.iceberg.PartitionSpec
- All Implemented Interfaces:
- Serializable
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:
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionstatic PartitionSpec.BuilderbuilderFor(Schema schema) Creates a newpartition spec builderfor the givenSchema.booleancompatibleWith(PartitionSpec other) Returns true if this spec is equivalent to the other, with partition field ids ignored.booleanfields()Returns the list ofpartition fieldsfor this spec.getFieldsBySourceId(int fieldId) Returns thefieldthat partitions the given source fieldinthashCode()Returns the source field ids for identity partitions.booleanbooleanClass<?>[]partitionToPath(StructLike data) Returns aTypes.StructTypefor partition data defined by this spec.Returns a struct matching partition information as written into manifest files.schema()Returns theSchemafor this spec.intspecId()Returns the ID of this spec.toString()static PartitionSpecReturns a spec for unpartitioned tables.
- 
Method Details- 
schemaReturns theSchemafor this spec.
- 
specIdpublic int specId()Returns the ID of this spec.
- 
fieldsReturns the list ofpartition fieldsfor this spec.
- 
isPartitionedpublic boolean isPartitioned()
- 
isUnpartitionedpublic boolean isUnpartitioned()
- 
toUnbound
- 
getFieldsBySourceIdReturns thefieldthat partitions the given source field- Parameters:
- fieldId- a field id from the source schema
- Returns:
- the fieldthat partitions the given source field
 
- 
partitionTypeReturns aTypes.StructTypefor partition data defined by this spec.
- 
rawPartitionTypeReturns a struct matching partition information as written into manifest files. SeepartitionType()for a struct with field ID's potentially re-assigned to avoid conflict.
- 
javaClasses
- 
partitionToPath
- 
compatibleWithReturns 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.- Parameters:
- other- another PartitionSpec
- Returns:
- true if the specs have the same fields, source columns, and transforms.
 
- 
equals
- 
hashCodepublic int hashCode()
- 
identitySourceIdsReturns the source field ids for identity partitions.- Returns:
- a set of source ids for the identity partitions.
 
- 
toString
- 
unpartitionedReturns a spec for unpartitioned tables.- Returns:
- a partition spec with no partitions
 
- 
builderForCreates a newpartition spec builderfor the givenSchema.- Parameters:
- schema- a schema
- Returns:
- a partition spec builder for the given schema
 
 
-