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 Summary
Modifier 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) hour()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
-
fromString
-
identity
Deprecated.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- thesource typefor the transform- Returns:
- an identity transform
-
year
Deprecated.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- thesource typefor the transform- Returns:
- a year transform
-
month
Deprecated.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- thesource typefor the transform- Returns:
- a month transform
-
day
Deprecated.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- thesource typefor the transform- Returns:
- a day transform
-
hour
Deprecated.usehour()instead; will be removed in 2.0.0Returns an hourTransformfor timestamps.- Type Parameters:
T- Java type passed to this transform- Parameters:
type- thesource typefor the transform- Returns:
- an hour transform
-
bucket
Deprecated.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- thesource typefor the transformnumBuckets- the number of buckets for the transform to produce- Returns:
- a transform that buckets values into numBuckets
-
truncate
Deprecated.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- thesource typefor the transformwidth- the width to truncate data values- Returns:
- a transform that truncates the given type to width
-
identity
Returns an identityTransformthat can be used for any type.- Type Parameters:
T- Java type passed to this transform- Returns:
- an identity transform
-
year
Returns a yearTransformfor date or timestamp types.- Type Parameters:
T- Java type passed to this transform- Returns:
- a year transform
-
month
Returns a monthTransformfor date or timestamp types.- Type Parameters:
T- Java type passed to this transform- Returns:
- a month transform
-
day
Returns a dayTransformfor date or timestamp types.- Type Parameters:
T- Java type passed to this transform- Returns:
- a day transform
-
hour
Returns an hourTransformfor timestamp types.- Type Parameters:
T- Java type passed to this transform- Returns:
- an hour transform
-
bucket
Returns 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
-
truncate
Returns 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
-
alwaysNull
Returns 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