Class BooleanChunkedFillByOperator
- All Implemented Interfaces:
ChunkedUpdateByOperator
public class BooleanChunkedFillByOperator extends BaseDynamicFillByOperator
SafeCloseable
object to carry forward context for a singular column
between iterations of chunk blocks.-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.updateby.fill.BaseDynamicFillByOperator
BaseDynamicFillByOperator.SingletonContext
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.updateby.ChunkedUpdateByOperator
ChunkedUpdateByOperator.BucketedUpdateContext, ChunkedUpdateByOperator.UpdateContext
-
Field Summary
Fields inherited from class com.illumon.iris.db.v2.updateby.fill.BaseDynamicFillByOperator
initialized, redirection
Fields inherited from interface com.illumon.iris.db.v2.updateby.ChunkedUpdateByOperator
ZERO_LENGTH_OP_ARRAY
-
Constructor Summary
Constructors Constructor Description BooleanChunkedFillByOperator(MatchPair fillPair, Table sourceTable)
-
Method Summary
Modifier and Type Method Description void
addChunk(ChunkedUpdateByOperator.UpdateContext inCtx, LongChunk<Attributes.OrderedKeyIndices> keyChunk, Chunk<Attributes.Values> valuesChunk, long groupPosition)
Add a chunk of values to this table.void
modifyChunk(ChunkedUpdateByOperator.UpdateContext inCtx, LongChunk<Attributes.OrderedKeyIndices> prevKeyChunk, LongChunk<Attributes.OrderedKeyIndices> keyChunk, Chunk<Attributes.Values> preValuesChunk, Chunk<Attributes.Values> postValuesChunk, long groupPosition)
Modify a chunk of values.Methods inherited from class com.illumon.iris.db.v2.updateby.fill.BaseDynamicFillByOperator
addChunk, anyModified, anyModified, applyShift, finishFor, finishFor, getAdditionalModifications, getInputColumnName, getOutputColumnNames, getOutputColumns, initializeFor, initializeFor, makeBucketedContext, makeUpdateContext, removeChunk, setBucketCapacity, setUpstream, setUpstream, startTrackingPrev
-
Constructor Details
-
Method Details
-
addChunk
public void addChunk(@NotNull ChunkedUpdateByOperator.UpdateContext inCtx, @NotNull LongChunk<Attributes.OrderedKeyIndices> keyChunk, @NotNull Chunk<Attributes.Values> valuesChunk, long groupPosition)Add a chunk of values to this table. The update process is essentially this:Iterate over the chunk of values: - If the value was null, then track that this row-key is redirected and set the value of the redirection to either, the last valid (non-null) row, or the Index null key, if no valid rows have been found
- If the value was NOT null then - Update the redirections for this row, to this key - If we passed a currently redirected index: - Update every redirection up to the current key with the last valid key - Any of these that changed become output modified rows. - Set the last valid key to this one, and add this key to the set of redirections to remove.
- Parameters:
inCtx
- the context object for this update.keyChunk
- the chunk of keys being added.valuesChunk
- the chunk of values being addedgroupPosition
-
-
modifyChunk
public void modifyChunk(@NotNull ChunkedUpdateByOperator.UpdateContext inCtx, @NotNull LongChunk<Attributes.OrderedKeyIndices> prevKeyChunk, @NotNull LongChunk<Attributes.OrderedKeyIndices> keyChunk, @NotNull Chunk<Attributes.Values> preValuesChunk, @NotNull Chunk<Attributes.Values> postValuesChunk, long groupPosition)Modify a chunk of values. This behaves much like aChunkedUpdateByOperator.removeChunk(UpdateContext, LongChunk, Chunk, long)
of previous values followed by anChunkedUpdateByOperator.addChunk(UpdateContext, LongChunk, Chunk, long)
of the current values with a few shortcuts.There are 4 possible scenarios
1: A row was previously null, and stayed null: We don't actually care. The redirection is already correct so there's nothing else to do
2: A row was previously null and became non-null Update the
BaseDynamicFillByOperator.redirection
to mark this row as not redirected and add it to the set of rows to be removed at the end of the cycle. Then, like an add, propagate forward any redirections between the last visited one, to this one3: A row was previously non-null and stayed non-null Nothing else to do here but check to see if we stepped past the next redirection index and propagate forward any redirections between the last visited one and this one
4: A row was previously non-null and became null First, locate what the new redirection must be by finding the last valid key before the row being modified. Update the
BaseDynamicFillByOperator.redirection
with that value then look to the right and update any rows that were redirected to this one onto the new redirection.- Parameters:
inCtx
- the context objectprevKeyChunk
- the chunk of previous keyskeyChunk
- the chunk of current keyspreValuesChunk
- the chunk of previous valuespostValuesChunk
- the chunk of current valuesgroupPosition
-
-