public class Transforms
extends java.lang.Object
Most users should create transforms using a
PartitionSpec.builderFor(Schema)
partition spec builder}.
The partition spec builder.
Modifier and Type | Method and Description |
---|---|
static <T> Transform<T,java.lang.Void> |
alwaysNull()
Returns a
Transform that always produces null. |
static <T> Transform<T,java.lang.Integer> |
bucket(Type type,
int numBuckets)
Returns a bucket
Transform for the given type and number of buckets. |
static <T> Transform<T,java.lang.Integer> |
day(Type type)
Returns a day
Transform for date or timestamp types. |
static Transform<?,?> |
fromString(Type type,
java.lang.String transform) |
static <T> Transform<T,java.lang.Integer> |
hour(Type type)
Returns a hour
Transform for timestamps. |
static <T> Transform<T,T> |
identity(Type type)
Returns an identity
Transform that can be used for any type. |
static <T> Transform<T,java.lang.Integer> |
month(Type type)
Returns a month
Transform for date or timestamp types. |
static <T> Transform<T,T> |
truncate(Type type,
int width)
Returns a truncate
Transform for the given type and width. |
static <T> Transform<T,java.lang.Integer> |
year(Type type)
Returns a year
Transform for date or timestamp types. |
public static <T> Transform<T,T> identity(Type type)
Transform
that can be used for any type.T
- Java type passed to this transformtype
- the source type
for the transformpublic static <T> Transform<T,java.lang.Integer> year(Type type)
Transform
for date or timestamp types.T
- Java type passed to this transformtype
- the source type
for the transformpublic static <T> Transform<T,java.lang.Integer> month(Type type)
Transform
for date or timestamp types.T
- Java type passed to this transformtype
- the source type
for the transformpublic static <T> Transform<T,java.lang.Integer> day(Type type)
Transform
for date or timestamp types.T
- Java type passed to this transformtype
- the source type
for the transformpublic static <T> Transform<T,java.lang.Integer> hour(Type type)
Transform
for timestamps.T
- Java type passed to this transformtype
- the source type
for the transformpublic static <T> Transform<T,java.lang.Integer> bucket(Type type, int numBuckets)
Transform
for the given type and number of buckets.T
- Java type passed to this transformtype
- the source type
for the transformnumBuckets
- the number of buckets for the transform to producepublic static <T> Transform<T,T> truncate(Type type, int width)
Transform
for the given type and width.T
- Java type passed to this transformtype
- the source type
for the transformwidth
- the width to truncate data values