Package org.apache.iceberg.transforms
Class Days<T>
- java.lang.Object
-
- org.apache.iceberg.transforms.Days<T>
-
- All Implemented Interfaces:
java.io.Serializable,Transform<T,java.lang.Integer>
public class Days<T> extends java.lang.Object- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Days()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SerializableFunction<S,java.lang.Integer>bind(Type type)Returns a function that applies this transform to values of the giventype.booleancanTransform(Type type)Checks whether this function can be applied to the givenType.java.lang.StringdedupName()Return the unique transform name to check if similar transforms for the same source field are added multiple times in partition spec builder.protected static <R> RfromSourceType(Type type, R dateResult, R microsResult, R nanosResult)TypegetResultType(Type sourceType)Returns theTypeproduced by this transform given a source type.protected java.time.temporal.ChronoUnitgranularity()booleanpreservesOrder()Whether the transform preserves the order of values (is monotonic).UnboundPredicate<java.lang.Integer>project(java.lang.String name, BoundPredicate<S> predicate)Transforms apredicateto an inclusive predicate on the partition values produced by the transform.UnboundPredicate<java.lang.Integer>projectStrict(java.lang.String name, BoundPredicate<S> predicate)Transforms apredicateto a strict predicate on the partition values produced by the transform.booleansatisfiesOrderOf(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.StringtoHumanString(Type alwaysDate, java.lang.Integer value)java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.iceberg.transforms.Transform
apply, isIdentity, isVoid, toHumanString
-
-
-
-
Method Detail
-
granularity
protected java.time.temporal.ChronoUnit granularity()
-
getResultType
public Type getResultType(Type sourceType)
Description copied from interface:TransformReturns theTypeproduced by this transform given a source type.- Parameters:
sourceType- a type- Returns:
- the result type created by the apply method for the given type
-
toHumanString
public java.lang.String toHumanString(Type alwaysDate, java.lang.Integer value)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fromSourceType
protected static <R> R fromSourceType(Type type, R dateResult, R microsResult, R nanosResult)
-
bind
public SerializableFunction<S,java.lang.Integer> bind(Type type)
Description copied from interface:TransformReturns a function that applies this transform to values of the giventype.
-
preservesOrder
public boolean preservesOrder()
Description copied from interface:TransformWhether the transform preserves the order of values (is monotonic).A transform preserves order for values when for any given a and b, if a < b then apply(a) <= apply(b).
- Specified by:
preservesOrderin interfaceTransform<S,java.lang.Integer>- Returns:
- true if the transform preserves the order of values
-
satisfiesOrderOf
public boolean satisfiesOrderOf(Transform<?,?> other)
Description copied from interface:TransformWhether ordering by this transform's result satisfies the ordering of another transform's result.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).
- Specified by:
satisfiesOrderOfin interfaceTransform<S,java.lang.Integer>- Returns:
- true if ordering by this transform is equivalent to ordering by the other transform
-
canTransform
public boolean canTransform(Type type)
Description copied from interface:TransformChecks whether this function can be applied to the givenType.- Specified by:
canTransformin interfaceTransform<S,java.lang.Integer>- Parameters:
type- a type- Returns:
- true if this transform can be applied to the type, false otherwise
-
project
public UnboundPredicate<java.lang.Integer> project(java.lang.String name, BoundPredicate<S> predicate)
Description copied from interface:TransformTransforms apredicateto 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.
-
projectStrict
public UnboundPredicate<java.lang.Integer> projectStrict(java.lang.String name, BoundPredicate<S> predicate)
Description copied from interface:TransformTransforms apredicateto 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.
- Specified by:
projectStrictin interfaceTransform<S,java.lang.Integer>- Parameters:
name- the field name for partition valuespredicate- a predicate for source values- Returns:
- an inclusive predicate on partition values
-
dedupName
public java.lang.String dedupName()
Description copied from interface:TransformReturn the unique transform name to check if similar transforms for the same source field are added multiple times in partition spec builder.
-
-