Package org.apache.iceberg.transforms
Class Transforms
java.lang.Object
org.apache.iceberg.transforms.Transforms
Factory methods for transforms.
 
Most users should create transforms using a PartitionSpec.builderFor(Schema) partition
 spec builder}.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionReturns aTransformthat always produces null.bucket(int numBuckets) Returns a bucketTransformfor the given number of buckets.Deprecated.day()Returns a dayTransformfor date or timestamp types.Deprecated.useday()instead; will be removed in 2.0.0static Transform<?, ?> fromString(String transform) static Transform<?, ?> fromString(Type type, String transform) Deprecated.useidentity()instead; will be removed in 2.0.0hour()Returns an hourTransformfor timestamp types.Deprecated.usehour()instead; will be removed in 2.0.0static <T> Transform<T, T> identity()Returns an identityTransformthat can be used for any type.static <T> Transform<T, T> Deprecated.useidentity()instead; will be removed in 2.0.0month()Returns a monthTransformfor date or timestamp types.Deprecated.usemonth()instead; will be removed in 2.0.0static <T> Transform<T, T> truncate(int width) Returns a truncateTransformfor the given width.static <T> Transform<T, T> Deprecated.usetruncate(int)instead; will be removed in 2.0.0year()Returns a yearTransformfor date or timestamp types.Deprecated.useyear()instead; will be removed in 2.0.0
- 
Method Details- 
fromString
- 
fromStringDeprecated.useidentity()instead; will be removed in 2.0.0
- 
identityDeprecated.useidentity()instead; will be removed in 2.0.0Returns an identityTransformthat can be used for any type.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- Returns:
- an identity transform
 
- 
yearDeprecated.useyear()instead; will be removed in 2.0.0Returns a yearTransformfor date or timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- Returns:
- a year transform
 
- 
monthDeprecated.usemonth()instead; will be removed in 2.0.0Returns a monthTransformfor date or timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- Returns:
- a month transform
 
- 
dayDeprecated.useday()instead; will be removed in 2.0.0Returns a dayTransformfor date or timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- Returns:
- a day transform
 
- 
hourDeprecated.usehour()instead; will be removed in 2.0.0Returns an hourTransformfor timestamps.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- Returns:
- an hour transform
 
- 
bucketDeprecated.usebucket(int)instead; will be removed in 2.0.0Returns a bucketTransformfor the given type and number of buckets.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- numBuckets- the number of buckets for the transform to produce
- Returns:
- a transform that buckets values into numBuckets
 
- 
truncateDeprecated.usetruncate(int)instead; will be removed in 2.0.0Returns a truncateTransformfor the given type and width.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- type- the- source typefor the transform
- width- the width to truncate data values
- Returns:
- a transform that truncates the given type to width
 
- 
identityReturns an identityTransformthat can be used for any type.- Type Parameters:
- T- Java type passed to this transform
- Returns:
- an identity transform
 
- 
yearReturns a yearTransformfor date or timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Returns:
- a year transform
 
- 
monthReturns a monthTransformfor date or timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Returns:
- a month transform
 
- 
dayReturns a dayTransformfor date or timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Returns:
- a day transform
 
- 
hourReturns an hourTransformfor timestamp types.- Type Parameters:
- T- Java type passed to this transform
- Returns:
- an hour transform
 
- 
bucketReturns a bucketTransformfor the given number of buckets.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- numBuckets- the number of buckets for the transform to produce
- Returns:
- a transform that buckets values into numBuckets
 
- 
truncateReturns a truncateTransformfor the given width.- Type Parameters:
- T- Java type passed to this transform
- Parameters:
- width- the width to truncate data values
- Returns:
- a transform that truncates the given type to width
 
- 
alwaysNullReturns aTransformthat always produces null.- Type Parameters:
- T- Java type accepted by the transform.
- Returns:
- a transform that always produces null (the void transform).
 
 
- 
bucket(int)instead; will be removed in 2.0.0