-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
410 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
...e/src/main/java/io/deephaven/engine/table/impl/updateby/minmax/CharCumMinMaxOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// | ||
// Copyright (c) 2016-2025 Deephaven Data Labs and Patent Pending | ||
// | ||
package io.deephaven.engine.table.impl.updateby.minmax; | ||
|
||
import io.deephaven.base.verify.Assert; | ||
import io.deephaven.chunk.Chunk; | ||
import io.deephaven.chunk.CharChunk; | ||
import io.deephaven.chunk.attributes.Values; | ||
import io.deephaven.engine.table.impl.MatchPair; | ||
import io.deephaven.engine.table.impl.updateby.UpdateByOperator; | ||
import io.deephaven.engine.table.impl.updateby.internal.BaseCharUpdateByOperator; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import static io.deephaven.util.QueryConstants.*; | ||
|
||
public class CharCumMinMaxOperator extends BaseCharUpdateByOperator { | ||
private final boolean isMax; | ||
|
||
// region extra-fields | ||
// endregion extra-fields | ||
|
||
protected class Context extends BaseCharUpdateByOperator.Context { | ||
public CharChunk<? extends Values> charValueChunk; | ||
|
||
protected Context(final int chunkSize) { | ||
super(chunkSize); | ||
} | ||
|
||
@Override | ||
public void setValueChunks(@NotNull final Chunk<? extends Values>[] valueChunks) { | ||
charValueChunk = valueChunks[0].asCharChunk(); | ||
} | ||
|
||
@Override | ||
public void push(int pos, int count) { | ||
Assert.eq(count, "push count", 1); | ||
|
||
final char val = charValueChunk.get(pos); | ||
|
||
if (curVal == NULL_CHAR) { | ||
curVal = val; | ||
} else if (val != NULL_CHAR) { | ||
if ((isMax && val > curVal) || | ||
(!isMax && val < curVal)) { | ||
curVal = val; | ||
} | ||
} | ||
} | ||
} | ||
|
||
public CharCumMinMaxOperator( | ||
@NotNull final MatchPair pair, | ||
final boolean isMax | ||
// region extra-constructor-args | ||
// endregion extra-constructor-args | ||
) { | ||
super(pair, new String[] {pair.rightColumn}); | ||
this.isMax = isMax; | ||
// region constructor | ||
// endregion constructor | ||
} | ||
|
||
@Override | ||
public UpdateByOperator copy() { | ||
return new CharCumMinMaxOperator( | ||
pair, | ||
isMax | ||
// region extra-copy-args | ||
// endregion extra-copy-args | ||
); | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public UpdateByOperator.Context makeUpdateContext(final int affectedChunkSize, final int influencerChunkSize) { | ||
return new Context(affectedChunkSize); | ||
} | ||
|
||
// region extra-methods | ||
// endregion extra-methods | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../src/main/java/io/deephaven/engine/table/impl/updateby/minmax/ShortCumMinMaxOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.