Package org.apache.calcite.rel.type
Class TimeFrameSet
java.lang.Object
org.apache.calcite.rel.type.TimeFrameSet
Set of
TimeFrame definitions.
Every SQL statement has a time frame set, and is accessed via
RelDataTypeSystem.deriveTimeFrameSet(TimeFrameSet). If you want to
use a custom set of time frames, you should override that method.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceBuilds a collection of time frames. -
Method Summary
Modifier and TypeMethodDescriptionintlongaddTimestamp(long timestamp, long interval, TimeFrame frame) static TimeFrameSet.Builderbuilder()Creates a Builder.intComputes "FLOOR(date TO frame)", wheredateis the number of days since UNIX Epoch.longceilTimestamp(long ts, TimeFrame frame) Computes "CEIL(timestamp TO frame)", wheretsis the number of milliseconds since UNIX Epoch.intlongdiffTimestamp(long timestamp, long timestamp2, TimeFrame frame) intComputes "FLOOR(date TO frame)", wheredateis the number of days since UNIX Epoch.longfloorTimestamp(long ts, TimeFrame frame) Computes "FLOOR(timestamp TO frame)", wheretsis the number of milliseconds since UNIX Epoch.Returns the time frame with the given name, or throwsIllegalArgumentExceptionif not found.get(org.apache.calcite.avatica.util.TimeUnit timeUnit) Returns the time frame with the given name, or throwsIllegalArgumentException.@Nullable TimeFrameReturns the time frame with the given name (case-insensitive), or returns null.@Nullable org.apache.calcite.avatica.util.TimeUnitReturns the time unit that this time frame is based upon, or null.
-
Method Details
-
builder
Creates a Builder. -
getOpt
Returns the time frame with the given name (case-insensitive), or returns null. -
get
Returns the time frame with the given name, or throwsIllegalArgumentExceptionif not found. Ifnameis an alias, resolves to the underlying frame. -
get
Returns the time frame with the given name, or throwsIllegalArgumentException. -
floorDate
Computes "FLOOR(date TO frame)", wheredateis the number of days since UNIX Epoch. -
ceilDate
Computes "FLOOR(date TO frame)", wheredateis the number of days since UNIX Epoch. -
floorTimestamp
Computes "FLOOR(timestamp TO frame)", wheretsis the number of milliseconds since UNIX Epoch. -
ceilTimestamp
Computes "CEIL(timestamp TO frame)", wheretsis the number of milliseconds since UNIX Epoch. -
getUnit
Returns the time unit that this time frame is based upon, or null. -
addDate
-
addTimestamp
-
diffDate
-
diffTimestamp
-