Package com.illumon.iris.db.v2.updateby
Interface UpdateByClause
- All Known Implementing Classes:
ColumnUpdateClause
public interface UpdateByClause
Defines an operation that can be applied to a table with
Table.updateBy(Collection, String...)-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic UpdateByClausedelta(DeltaControl control, String... columns) Compute the cell by cell delta values for each column.static UpdateByClauseCompute the cell by cell delta values for each column.static UpdateByClauseema(long timeScaleTicks, EmaControl.Builder control, String... columns) Create an Exponential Moving Average of the specified columns, using ticks as the decay unit.static UpdateByClauseema(long timeScaleTicks, EmaControl control, String... columns) Create an Exponential Moving Average of the specified columns, using ticks as the decay unit.static UpdateByClauseema(String timestampColumn, long timeScaleNanos, EmaControl.Builder control, String... columns) Create an Exponential Moving Average of the specified columns, using time as the decay unit.static UpdateByClauseema(String timestampColumn, long timeScaleNanos, EmaControl control, String... columns) Create an Exponential Moving Average of the specified columns, using time as the decay unit.static UpdateByClauseCreate a forward fill operation for the specified columns.static UpdateByClauseCreate a Cumulative Maximum of the specified columns.static UpdateByClauseCreate a Cumulative Minimum of the specified columns.static ColumnUpdateClauseof(UpdateBySpec spec, String... columns) Conjoin anUpdateBySpecwith columns for it to be applied to so the engine can construct the proper operators.static Collection<UpdateByClause>of(UpdateByClause... operations) Simply wrap the input specs as a collection suitable forTable.updateBy(UpdateByControl, Collection, MatchPair...).static UpdateByClauseCreate a Cumulative Product of the specified columns.static UpdateByClauseCreate a forward fill operation for the specified columns.<V extends UpdateByClause.Visitor>
Vwalk(V v)
-
Method Details
-
of
Conjoin anUpdateBySpecwith columns for it to be applied to so the engine can construct the proper operators.- Parameters:
spec- theUpdateBySpecthat defines the operation to performcolumns- the columns to apply the operation to.- Returns:
- a
ColumnUpdateClausethat will be used to construct operations for each column
-
of
Simply wrap the input specs as a collection suitable forTable.updateBy(UpdateByControl, Collection, MatchPair...). This is functionally equivalent toArrays.asList(Object[]).- Parameters:
operations- the operations to wrap.- Returns:
- a collection for use with
Table.updateBy(UpdateByControl, Collection, MatchPair...)
-
sum
Create a forward fill operation for the specified columns.- Parameters:
columnsToSum- the columns to fill.- Returns:
- a new
UpdateByClausefor performing a forward fill withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
fill
Create a forward fill operation for the specified columns.- Parameters:
columnsToFill- the columns to fill.- Returns:
- a new
UpdateByClausefor performing a forward fill withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
min
Create a Cumulative Minimum of the specified columns.- Parameters:
columns- the columns to find the min- Returns:
- a new
UpdateByClausefor performing a cumulative min withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
max
Create a Cumulative Maximum of the specified columns.- Parameters:
columns- the columns to find the min- Returns:
- a new
UpdateByClausefor performing a cumulative max withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
prod
Create a Cumulative Product of the specified columns.- Parameters:
columns- the columns to find the min- Returns:
- a new
UpdateByClausefor performing a cumulative produce withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
ema
static UpdateByClause ema(long timeScaleTicks, @NotNull EmaControl.Builder control, String... columns) Create an Exponential Moving Average of the specified columns, using ticks as the decay unit.The formula used is
a = e^(-1 / timeScaleTicks) ema_next = a * ema_last + (1 - a) * value- Parameters:
timeScaleTicks- the decay rate (tau) in tickscontrol- acontrolobject that defines how special cases should behave. SeeEmaControlfor further details.columns- the columns to apply the EMA to.- Returns:
- a new
UpdateByClausefor performing an EMA withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
ema
Create an Exponential Moving Average of the specified columns, using ticks as the decay unit.The formula used is
a = e^(-1 / timeScaleTicks) ema_next = a * ema_last + (1 - a) * value- Parameters:
timeScaleTicks- the decay rate (tau) in tickscontrol- acontrolobject that defines how special cases should behave. SeeEmaControlfor further details.columns- the columns to apply the EMA to.- Returns:
- a new
UpdateByClausefor performing an EMA withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
ema
static UpdateByClause ema(@NotNull String timestampColumn, long timeScaleNanos, @NotNull EmaControl.Builder control, String... columns) Create an Exponential Moving Average of the specified columns, using time as the decay unit.
The formula used is
a = e^(-dt / timeScaleNanos) ema_next = a * ema_last + (1 - a) * value- Parameters:
timestampColumn- the column in the source table to use for timestampstimeScaleNanos- the decay rate (tau) in nanosecondscontrol- acontrolobject that defines how special cases should behave. SeeEmaControlfor further details.columns- the columns to apply the EMA to.- Returns:
- a new
UpdateByClausefor performing an EMA withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
ema
static UpdateByClause ema(@NotNull String timestampColumn, long timeScaleNanos, @NotNull EmaControl control, String... columns) Create an Exponential Moving Average of the specified columns, using time as the decay unit.The formula used is
a = e^(-dt / timeScaleNanos) ema_next = a * ema_last + (1 - a) * value- Parameters:
timestampColumn- the column in the source table to use for timestampstimeScaleNanos- the decay rate (tau) in nanosecondscontrol- acontrolobject that defines how special cases should behave. SeeEmaControlfor further details.columns- the columns to apply the EMA to.- Returns:
- a new
UpdateByClausefor performing an EMA withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
delta
Compute the cell by cell delta values for each column. Result columns maintain the same type as the original, with the exception of timestamps which represent the difference in nanoseconds.- Parameters:
columns- the columns to compute deltas for- Returns:
- a new
UpdateByClausefor performing a delta operation withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
delta
Compute the cell by cell delta values for each column. Result columns maintain the same type as the original, with the exception of timestamps which represent the difference in nanoseconds.- Parameters:
control- theDeltaControlobject to control the behavior when null values are encounteredcolumns- the columns to compute deltas for- Returns:
- a new
UpdateByClausefor performing a delta operation withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
walk
-