Class RollingGroupOperator
java.lang.Object
io.deephaven.engine.table.impl.updateby.UpdateByOperator
io.deephaven.engine.table.impl.updateby.rollinggroup.RollingGroupOperator
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected WritableColumnSource<Long>
protected WritableColumnSource<? extends RowSet>
Store a mapping from row keys to bucket RowSetsprotected LongArraySource
protected ObjectArraySource<? extends RowSet>
protected LongArraySource
protected WritableColumnSource<Long>
These sources will retain the position offsets from the current row position for the source and end of this window.Fields inherited from class io.deephaven.engine.table.impl.updateby.UpdateByOperator
affectingColumns, forwardWindowScaleUnits, inputModifiedColumnSet, isWindowed, outputModifiedColumnSet, pair, reverseWindowScaleUnits, rowRedirection, timestampColumnName
-
Constructor Summary
ModifierConstructorDescriptionRollingGroupOperator
(@NotNull MatchPair[] pairs, @NotNull String[] affectingColumns, @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits, @NotNull TableDefinition tableDef) protected
RollingGroupOperator
(@NotNull MatchPair[] pairs, @NotNull String[] affectingColumns, @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits, @NotNull String[] inputColumnNames, @NotNull String[] outputColumnNames) -
Method Summary
Modifier and TypeMethodDescriptionvoid
applyOutputShift
(@NotNull RowSet subRowSetToShift, long delta) Apply a shift to the operation.void
clearOutputRows
(RowSet toClear) Clear the output rows by setting value to NULL.copy()
Create an uninitialized copy of this operator.protected void
createInputModifiedColumnSet
(@NotNull QueryTable source) Create the modified column set for the input columns of this operator.protected void
createOutputModifiedColumnSet
(@NotNull QueryTable result) Create the modified column set for the output columns from this operator.protected void
extractDownstreamModifiedColumnSet
(@NotNull TableUpdate upstream, @NotNull TableUpdate downstream) Set the downstream modified column set appropriately for this operator.protected @NotNull String[]
Get the names of the input column(s) for this operator.protected @NotNull String[]
Get an array of the output column names.@NotNull Map<String,
ColumnSource<?>> Get a map of outputName to outputColumnSource
for this operation.void
initializeRolling
(UpdateByOperator.Context context, @NotNull RowSet bucketRowSet) Initialize the bucket context for a windowed operatorvoid
initializeSources
(@NotNull Table source, @Nullable RowRedirection rowRedirection) Initialize this operator with a specific source table (and row redirection if needed).makeUpdateContext
(int chunkSize, int influencerChunkSize) Make anUpdateByOperator.Context
suitable for use with updates.void
prepareForParallelPopulation
(RowSet changedRows) Prepare this operator output column for parallel updated.protected boolean
Return whether the operator needs affected and influencer row positions during accumulation.void
Indicate that the operation should start tracking previous values for ticking updates.Methods inherited from class io.deephaven.engine.table.impl.updateby.UpdateByOperator
finishUpdate, getAffectingColumnNames, getFwdWindowUnits, getInputModifiedColumnSet, getOutputModifiedColumnSet, getPrevWindowUnits, getTimestampColumnName, initializeCumulative
-
Field Details
-
groupRowSetSource
Store a mapping from row keys to bucket RowSets -
innerGroupRowSetSource
-
startSource
These sources will retain the position offsets from the current row position for the source and end of this window. A primary benefit of storing offsets in position space vs. row keys is eliminating the need to shift keys stored inside these column sources. Also, any insertion/modification/remove that occurs within this specified window will trigger re-computation of these position offsets.NOTE: these offsets are inclusive and are stored as simple relative positions where start==0 or end==0 implies the current row is included in the window. A start/end range of [-5,-3] defines a window including exactly 3 rows beginning 5 rows earlier than this one and continuing through 3 rows earlier than this (inclusive). A range of [0,0] contains exactly the current row.
-
innerStartSource
-
endSource
-
innerEndSource
-
-
Constructor Details
-
RollingGroupOperator
public RollingGroupOperator(@NotNull @NotNull MatchPair[] pairs, @NotNull @NotNull String[] affectingColumns, @Nullable @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits, @NotNull @NotNull TableDefinition tableDef) -
RollingGroupOperator
protected RollingGroupOperator(@NotNull @NotNull MatchPair[] pairs, @NotNull @NotNull String[] affectingColumns, @Nullable @Nullable String timestampColumnName, long reverseWindowScaleUnits, long forwardWindowScaleUnits, @NotNull @NotNull String[] inputColumnNames, @NotNull @NotNull String[] outputColumnNames)
-
-
Method Details
-
copy
Description copied from class:UpdateByOperator
Create an uninitialized copy of this operator.UpdateByOperator.initializeSources(Table, RowRedirection)
must be called before this operator can be used.- Specified by:
copy
in classUpdateByOperator
- Returns:
- a copy of this operator
-
initializeSources
public void initializeSources(@NotNull @NotNull Table source, @Nullable @Nullable RowRedirection rowRedirection) Description copied from class:UpdateByOperator
Initialize this operator with a specific source table (and row redirection if needed). This will be called exactly once per operator.- Specified by:
initializeSources
in classUpdateByOperator
-
makeUpdateContext
Description copied from class:UpdateByOperator
Make anUpdateByOperator.Context
suitable for use with updates.- Specified by:
makeUpdateContext
in classUpdateByOperator
- Parameters:
chunkSize
- The maximum size of affected chunks that will be provided during the update.influencerChunkSize
- The maximum size of influencer chunks that will be provided during the update.- Returns:
- a new context
-
prepareForParallelPopulation
Description copied from class:UpdateByOperator
Prepare this operator output column for parallel updated.- Specified by:
prepareForParallelPopulation
in classUpdateByOperator
-
initializeRolling
public void initializeRolling(@NotNull UpdateByOperator.Context context, @NotNull @NotNull RowSet bucketRowSet) Description copied from class:UpdateByOperator
Initialize the bucket context for a windowed operator- Overrides:
initializeRolling
in classUpdateByOperator
-
applyOutputShift
Description copied from class:UpdateByOperator
Apply a shift to the operation.- Specified by:
applyOutputShift
in classUpdateByOperator
-
clearOutputRows
Description copied from class:UpdateByOperator
Clear the output rows by setting value to NULL. Dense sources will apply removes to the inner source.- Specified by:
clearOutputRows
in classUpdateByOperator
-
startTrackingPrev
public void startTrackingPrev()Description copied from class:UpdateByOperator
Indicate that the operation should start tracking previous values for ticking updates.- Specified by:
startTrackingPrev
in classUpdateByOperator
-
getOutputColumnNames
Get an array of the output column names.- Overrides:
getOutputColumnNames
in classUpdateByOperator
- Returns:
- the output column names.
-
getOutputColumns
Get a map of outputName to outputColumnSource
for this operation.- Specified by:
getOutputColumns
in classUpdateByOperator
- Returns:
- a map of output column name to output column source
-
getInputColumnNames
Get the names of the input column(s) for this operator.- Overrides:
getInputColumnNames
in classUpdateByOperator
- Returns:
- the names of the input column
-
requiresRowPositions
protected boolean requiresRowPositions()Return whether the operator needs affected and influencer row positions during accumulation. RollingGroup sets this totrue
.- Overrides:
requiresRowPositions
in classUpdateByOperator
-
createInputModifiedColumnSet
Create the modified column set for the input columns of this operator.- Overrides:
createInputModifiedColumnSet
in classUpdateByOperator
-
createOutputModifiedColumnSet
Create the modified column set for the output columns from this operator.- Overrides:
createOutputModifiedColumnSet
in classUpdateByOperator
-
extractDownstreamModifiedColumnSet
protected void extractDownstreamModifiedColumnSet(@NotNull @NotNull TableUpdate upstream, @NotNull @NotNull TableUpdate downstream) Set the downstream modified column set appropriately for this operator.- Overrides:
extractDownstreamModifiedColumnSet
in classUpdateByOperator
-