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 UpdateByClause
delta
(DeltaControl control, String... columns) Compute the cell by cell delta values for each column.static UpdateByClause
Compute the cell by cell delta values for each column.static UpdateByClause
ema
(long timeScaleTicks, EmaControl.Builder control, String... columns) Create an Exponential Moving Average of the specified columns, using ticks as the decay unit.static UpdateByClause
ema
(long timeScaleTicks, EmaControl control, String... columns) Create an Exponential Moving Average of the specified columns, using ticks as the decay unit.static UpdateByClause
ema
(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 UpdateByClause
ema
(String timestampColumn, long timeScaleNanos, EmaControl control, String... columns) Create an Exponential Moving Average of the specified columns, using time as the decay unit.static UpdateByClause
Create a forward fill operation for the specified columns.static UpdateByClause
Create a Cumulative Maximum of the specified columns.static UpdateByClause
Create a Cumulative Minimum of the specified columns.static ColumnUpdateClause
of
(UpdateBySpec spec, String... columns) Conjoin anUpdateBySpec
with 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 UpdateByClause
Create a Cumulative Product of the specified columns.static UpdateByClause
Create a forward fill operation for the specified columns.<V extends UpdateByClause.Visitor>
Vwalk
(V v)
-
Method Details
-
of
Conjoin anUpdateBySpec
with columns for it to be applied to so the engine can construct the proper operators.- Parameters:
spec
- theUpdateBySpec
that defines the operation to performcolumns
- the columns to apply the operation to.- Returns:
- a
ColumnUpdateClause
that 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
UpdateByClause
for 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
UpdateByClause
for 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
UpdateByClause
for 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
UpdateByClause
for 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
UpdateByClause
for 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
- acontrol
object that defines how special cases should behave. SeeEmaControl
for further details.columns
- the columns to apply the EMA to.- Returns:
- a new
UpdateByClause
for 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
- acontrol
object that defines how special cases should behave. SeeEmaControl
for further details.columns
- the columns to apply the EMA to.- Returns:
- a new
UpdateByClause
for 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
- acontrol
object that defines how special cases should behave. SeeEmaControl
for further details.columns
- the columns to apply the EMA to.- Returns:
- a new
UpdateByClause
for 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
- acontrol
object that defines how special cases should behave. SeeEmaControl
for further details.columns
- the columns to apply the EMA to.- Returns:
- a new
UpdateByClause
for 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
UpdateByClause
for 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
- theDeltaControl
object to control the behavior when null values are encounteredcolumns
- the columns to compute deltas for- Returns:
- a new
UpdateByClause
for performing a delta operation withTable.updateBy(UpdateByControl, Collection, MatchPair...)
-
walk
-