Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/distro/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
- "${DEEPHAVEN_PORT:-10000}:10000"
volumes:
- ./data:/data
- ./minio:/minio
environment:
- "START_OPTS=-Xmx24G -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* Copyright (c) 2025-2025 Deephaven Data Labs and Patent Pending */
package io.deephaven.benchmark.tests.standard.aggby;

import org.junit.jupiter.api.*;
import io.deephaven.benchmark.tests.standard.StandardTestRunner;

/**
* Standard tests for the countWhere table operation. Returns the number of rows for each group.
*/
public class CountWhereTest {
final StandardTestRunner runner = new StandardTestRunner(this);

@BeforeEach
void setup() {
runner.setRowFactor(6);
runner.tables("source");

var setupStr = """
from deephaven import agg

aggs=[agg.count_where(col="count", filters=["num1 > 3"])]
""";
runner.addSetupQuery(setupStr);
}

@Test
void countWhere1Group() {
runner.setScaleFactors(8, 7);
var q = "source.agg_by(aggs, by=['key1'])";
runner.test("CountWhere-AggBy- 1 Group 100 Unique Vals", 100, q, "key1", "num1");
}

@Test
void countWhere2Group() {
runner.setScaleFactors(3, 2);
var q = "source.agg_by(aggs, by=['key1', 'key2'])";
runner.test("CountWhere-AggBy- 2 Groups 10K Unique Combos", 10100, q, "key1", "key2", "num1");
}

@Test
void countWhere3Group() {
runner.setScaleFactors(2, 1);
var q = "source.agg_by(aggs, by=['key1', 'key2', 'key3'])";
runner.test("CountWhere-AggBy- 3 Groups 100K Unique Combos", 90900, q, "key1", "key2", "key3", "num1");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/* Copyright (c) 2025-2025 Deephaven Data Labs and Patent Pending */
package io.deephaven.benchmark.tests.standard.updateby;

import org.junit.jupiter.api.*;
import io.deephaven.benchmark.tests.standard.StandardTestRunner;

/**
* Standard tests for the updateBy table operation. Calculates a cumulative countWhere for specified columns and places
* the result into a new column for each row.
*/
public class CumCountWhereTest {
final StandardTestRunner runner = new StandardTestRunner(this);

void setup(int rowFactor, int staticFactor, int incFactor) {
runner.setRowFactor(rowFactor);
runner.setScaleFactors(staticFactor, incFactor);
runner.tables("timed");
runner.addSetupQuery("from deephaven.updateby import cum_count_where");
}

@Test
void cumCountWhere0Group1Col() {
setup(5, 10, 10);
var q = "timed.update_by(ops=cum_count_where(col='X', filters=['num1 > 3']))";
runner.test("CumCountWhere- No Groups 1 Col", q, "num1");
}

@Test
void cumCountWhere1Group1Col() {
setup(3, 10, 2);
var q = "timed.update_by(ops=cum_count_where(col='X', filters=['num1 > 3']), by=['key1'])";
runner.test("CumCountWhere- 1 Group 100 Unique Vals", q, "key1", "num1");
}

@Test
void cumCountWhere2Groups1Col() {
setup(2, 3, 1);
var q = "timed.update_by(ops=cum_count_where(col='X', filters=['num1 > 3']), by=['key1','key2'])";
runner.test("CumCountWhere- 2 Groups 10K Unique Combos", q, "key1", "key2", "num1");
}

@Test
void cumCountWhere3Groups1Col() {
setup(1, 3, 1);
var q = "timed.update_by(ops=cum_count_where(col='X', filters=['num1 > 3']), by=['key1','key2','key3'])";
runner.test("CumCountWhere- 3 Groups 100K Unique Combos", q, "key1", "key2", "key3", "num1");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/* Copyright (c) 2025-2025 Deephaven Data Labs and Patent Pending */
package io.deephaven.benchmark.tests.standard.updateby;

import org.junit.jupiter.api.*;
import io.deephaven.benchmark.tests.standard.StandardTestRunner;

/**
* Standard tests for the updateBy table operation. Defines a tick-based rolling countWhere. The result table contains
* an additional column with windowed rolling countWhere.
* <p>
* Note: This test must contain benchmarks and <code>rev_ticks/fwd_ticks</code> that are comparable to
* <code>RollingCountWhereTimeTest</code>
*/
public class RollingCountWhereTickTest {
final StandardTestRunner runner = new StandardTestRunner(this);
final Setup setup = new Setup(runner);
final String thousands = """
from deephaven.updateby import rolling_count_where_tick
contains_row = rolling_count_where_tick('X',filters=["num1 > 3"],rev_ticks=2000,fwd_ticks=3000)
""";
final String fifty = """
from deephaven.updateby import rolling_count_where_tick
contains_row = rolling_count_where_tick('X',filters=["num1 > 3"],rev_ticks=20,fwd_ticks=30)
""";

@Test
void rollingCountWhereTick0Group3Ops() {
setup.factors(5, 8, 8);
runner.addSetupQuery(thousands);
var q = "timed.update_by(ops=[contains_row])";
runner.test("RollingCountWhereTick- No Groups 1 Col", q, "num1");
}

@Test
void rollingCountWhereTick1Group3Ops() {
setup.factors(5, 4, 1);
runner.addSetupQuery(fifty);
var q = "timed.update_by(ops=[contains_row], by=['key1'])";
runner.test("RollingCountWhereTick- 1 Group 100 Unique Vals", q, "key1", "num1");
}

@Test
void rollingCountWhereTick2Groups3Ops() {
setup.factors(2, 3, 1);
runner.addSetupQuery(fifty);
var q = "timed.update_by(ops=[contains_row], by=['key1','key2'])";
runner.test("RollingCountWhereTick- 2 Groups 10K Unique Combos", q, "key1", "key2", "num1");
}

@Test
void rollingCountWhereTick3Groups3Ops() {
setup.factors(1, 3, 1);
runner.addSetupQuery(fifty);
var q = "timed.update_by(ops=[contains_row], by=['key1','key2','key3'])";
runner.test("RollingCountWhereTick- 3 Groups 100K Unique Combos", q, "key1", "key2", "key3", "num1");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/* Copyright (c) 2025-2025 Deephaven Data Labs and Patent Pending */
package io.deephaven.benchmark.tests.standard.updateby;

import org.junit.jupiter.api.*;
import io.deephaven.benchmark.tests.standard.StandardTestRunner;

/**
* Standard tests for the updateBy table operation. Defines a time-based rolling countWhere. The result table contains
* an additional column with windowed rolling countWhere.
* <p>
* Note: This test must contain benchmarks and <code>rev_time/fwd_time</code> that are comparable to
* <code>RollingCountWhereTickTest</code>
*/
public class RollingCountWhereTimeTest {
final StandardTestRunner runner = new StandardTestRunner(this);
final Setup setup = new Setup(runner);
final String thousands = """
from deephaven.updateby import rolling_count_where_time
contains_row = rolling_count_where_time("timestamp",'X',filters=["num1 > 3"],rev_time="PT2S",fwd_time="PT3S")
""";
final String fifty1Group = """
from deephaven.updateby import rolling_count_where_time
contains_row = rolling_count_where_time("timestamp",'X',filters=["num1 > 3"],rev_time="PT2S",fwd_time="PT3S")
""";
final String fifty2Groups = """
from deephaven.updateby import rolling_count_where_time
contains_row = rolling_count_where_time("timestamp",'X',filters=["num1 > 3"],rev_time="PT4M",fwd_time="PT5M")
""";
final String fifty3Groups = """
from deephaven.updateby import rolling_count_where_time
contains_row = rolling_count_where_time("timestamp",'X',filters=["num1 > 3"],rev_time="PT40M",fwd_time="PT50M")
""";

@Test
void rollingCountWhereTime0Group3Ops() {
setup.factors(5, 4, 3);
runner.addSetupQuery(thousands);
var q = "timed.update_by(ops=[contains_row])";
runner.test("RollingCountWhereTime- No Groups 1 Col", q, "num1", "timestamp");
}

@Test
void rollingCountWhereTime1Group3Ops() {
setup.factors(4, 2, 1);
runner.addSetupQuery(fifty1Group);
var q = "timed.update_by(ops=[contains_row], by=['key1'])";
runner.test("RollingCountWhereTime- 1 Group 100 Unique Vals", q, "key1", "num1", "timestamp");
}

@Test
void rollingCountWhereTime2Groups3Ops() {
setup.factors(2, 2, 1);
runner.addSetupQuery(fifty2Groups);
var q = "timed.update_by(ops=[contains_row], by=['key1','key2'])";
runner.test("RollingCountWhereTime- 2 Groups 10K Unique Combos", q, "key1", "key2", "num1", "timestamp");
}

@Test
void rollingCountWhereTime3Groups3Ops() {
setup.factors(1, 3, 1);
runner.addSetupQuery(fifty3Groups);
var q = "timed.update_by(ops=[contains_row], by=['key1','key2','key3'])";
runner.test("RollingCountWhereTime- 3 Groups 100K Unique Combos", q, "key1", "key2", "key3", "num1", "timestamp");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
with urlopen(root + '/deephaven-benchmark/benchmark_tables.dh.py') as r:
benchmark_storage_uri_arg = root + '/deephaven-benchmark'
benchmark_category_arg = 'nightly' # release | nightly
benchnark_max_sets_arg = 45
benchmark_max_sets_arg = 45
benchmark_actor_filter_arg = 'deephaven'
benchmark_set_filter_arg = '[0-9]{4}([-][0-9]{2}){2}' # yyyy-mm-dd
exec(r.read().decode(), globals(), locals())
Expand Down