public class Months<T>
extends java.lang.Object
Constructor and Description |
---|
Months() |
Modifier and Type | Method and Description |
---|---|
SerializableFunction<S,java.lang.Integer> |
bind(Type type)
Returns a function that applies this transform to values of the given
type . |
boolean |
canTransform(Type type)
Checks whether this function can be applied to the given
Type . |
java.lang.String |
dedupName()
Return the unique transform name to check if similar transforms for the same source field are
added multiple times in partition spec builder.
|
Type |
getResultType(Type sourceType)
Returns the
Type produced by this transform given a source type. |
boolean |
preservesOrder()
Whether the transform preserves the order of values (is monotonic).
|
UnboundPredicate<java.lang.Integer> |
project(java.lang.String name,
BoundPredicate<S> predicate)
Transforms a
predicate to an inclusive predicate on the partition values
produced by the transform. |
UnboundPredicate<java.lang.Integer> |
projectStrict(java.lang.String name,
BoundPredicate<S> predicate)
Transforms a
predicate to a strict predicate on the partition values
produced by the transform. |
boolean |
satisfiesOrderOf(Transform<?,?> other)
Whether ordering by this transform's result satisfies the ordering of another transform's
result.
|
protected Transform<T,java.lang.Integer> |
toEnum(Type type) |
java.lang.String |
toHumanString(Type alwaysInt,
java.lang.Integer value) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
apply, isIdentity, toHumanString
public Type getResultType(Type sourceType)
Transform
Type
produced by this transform given a source type.sourceType
- a typepublic boolean satisfiesOrderOf(Transform<?,?> other)
Transform
For example, sorting by day(ts) will produce an ordering that is also by month(ts) or year(ts). However, sorting by day(ts) will not satisfy the order of hour(ts) or identity(ts).
public java.lang.String toHumanString(Type alwaysInt, java.lang.Integer value)
public java.lang.String toString()
toString
in class java.lang.Object
public SerializableFunction<S,java.lang.Integer> bind(Type type)
Transform
type
.public boolean preservesOrder()
Transform
A transform preserves order for values when for any given a and b, if a < b then apply(a) <= apply(b).
preservesOrder
in interface Transform<S,java.lang.Integer>
public boolean canTransform(Type type)
Transform
Type
.canTransform
in interface Transform<S,java.lang.Integer>
type
- a typepublic UnboundPredicate<java.lang.Integer> project(java.lang.String name, BoundPredicate<S> predicate)
Transform
predicate
to an inclusive predicate on the partition values
produced by the transform.
This inclusive transform guarantees that if pred(v) is true, then projected(apply(v)) is true.
public UnboundPredicate<java.lang.Integer> projectStrict(java.lang.String name, BoundPredicate<S> predicate)
Transform
predicate
to a strict predicate on the partition values
produced by the transform.
This strict transform guarantees that if strict(apply(v)) is true, then pred(v) is also true.
projectStrict
in interface Transform<S,java.lang.Integer>
name
- the field name for partition valuespredicate
- a predicate for source valuespublic java.lang.String dedupName()
Transform