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(int numBuckets)
Returns a bucket
Transform for the given number of buckets. |
static <T> Transform<T,java.lang.Integer> |
bucket(Type type,
int numBuckets)
Deprecated.
use
bucket(int) instead; will be removed in 2.0.0 |
static <T> Transform<T,java.lang.Integer> |
day()
Returns a day
Transform for date or timestamp types. |
static <T> Transform<T,java.lang.Integer> |
day(Type type)
Deprecated.
use
day() instead; will be removed in 2.0.0 |
static Transform<?,?> |
fromString(java.lang.String transform) |
static Transform<?,?> |
fromString(Type type,
java.lang.String transform) |
static <T> Transform<T,java.lang.Integer> |
hour()
Returns an hour
Transform for timestamp types. |
static <T> Transform<T,java.lang.Integer> |
hour(Type type)
Deprecated.
use
hour() instead; will be removed in 2.0.0 |
static <T> Transform<T,T> |
identity()
Returns an identity
Transform that can be used for any type. |
static <T> Transform<T,T> |
identity(Type type)
Deprecated.
use
identity() instead; will be removed in 2.0.0 |
static <T> Transform<T,java.lang.Integer> |
month()
Returns a month
Transform for date or timestamp types. |
static <T> Transform<T,java.lang.Integer> |
month(Type type)
Deprecated.
use
month() instead; will be removed in 2.0.0 |
static <T> Transform<T,T> |
truncate(int width)
Returns a truncate
Transform for the given width. |
static <T> Transform<T,T> |
truncate(Type type,
int width)
Deprecated.
use
truncate(int) instead; will be removed in 2.0.0 |
static <T> Transform<T,java.lang.Integer> |
year()
Returns a year
Transform for date or timestamp types. |
static <T> Transform<T,java.lang.Integer> |
year(Type type)
Deprecated.
use
year() instead; will be removed in 2.0.0 |
public static Transform<?,?> fromString(java.lang.String transform)
@Deprecated public static <T> Transform<T,T> identity(Type type)
identity()
instead; will be removed in 2.0.0Transform
that can be used for any type.T
- Java type passed to this transformtype
- the source type
for the transform@Deprecated public static <T> Transform<T,java.lang.Integer> year(Type type)
year()
instead; will be removed in 2.0.0Transform
for date or timestamp types.T
- Java type passed to this transformtype
- the source type
for the transform@Deprecated public static <T> Transform<T,java.lang.Integer> month(Type type)
month()
instead; will be removed in 2.0.0Transform
for date or timestamp types.T
- Java type passed to this transformtype
- the source type
for the transform@Deprecated public static <T> Transform<T,java.lang.Integer> day(Type type)
day()
instead; will be removed in 2.0.0Transform
for date or timestamp types.T
- Java type passed to this transformtype
- the source type
for the transform@Deprecated public static <T> Transform<T,java.lang.Integer> hour(Type type)
hour()
instead; will be removed in 2.0.0Transform
for timestamps.T
- Java type passed to this transformtype
- the source type
for the transform@Deprecated public static <T> Transform<T,java.lang.Integer> bucket(Type type, int numBuckets)
bucket(int)
instead; will be removed in 2.0.0Transform
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 produce@Deprecated public static <T> Transform<T,T> truncate(Type type, int width)
truncate(int)
instead; will be removed in 2.0.0Transform
for the given type and width.T
- Java type passed to this transformtype
- the source type
for the transformwidth
- the width to truncate data valuespublic static <T> Transform<T,T> identity()
Transform
that can be used for any type.T
- Java type passed to this transformpublic static <T> Transform<T,java.lang.Integer> year()
Transform
for date or timestamp types.T
- Java type passed to this transformpublic static <T> Transform<T,java.lang.Integer> month()
Transform
for date or timestamp types.T
- Java type passed to this transformpublic static <T> Transform<T,java.lang.Integer> day()
Transform
for date or timestamp types.T
- Java type passed to this transformpublic static <T> Transform<T,java.lang.Integer> hour()
Transform
for timestamp types.T
- Java type passed to this transformpublic static <T> Transform<T,java.lang.Integer> bucket(int numBuckets)
Transform
for the given number of buckets.T
- Java type passed to this transformnumBuckets
- the number of buckets for the transform to producepublic static <T> Transform<T,T> truncate(int width)
Transform
for the given width.T
- Java type passed to this transformwidth
- the width to truncate data values