diff --git a/.github/distro/docker-compose.yml b/.github/distro/docker-compose.yml index b044d5ca..e82ceec1 100644 --- a/.github/distro/docker-compose.yml +++ b/.github/distro/docker-compose.yml @@ -5,6 +5,7 @@ services: - "${DEEPHAVEN_PORT:-10000}:10000" volumes: - ./data:/data + - ./minio:/minio environment: - "START_OPTS=-Xmx24G -DAuthHandlers=io.deephaven.auth.AnonymousAuthenticationHandler" diff --git a/src/it/java/io/deephaven/benchmark/tests/standard/aggby/CountWhereTest.java b/src/it/java/io/deephaven/benchmark/tests/standard/aggby/CountWhereTest.java new file mode 100644 index 00000000..102b01bf --- /dev/null +++ b/src/it/java/io/deephaven/benchmark/tests/standard/aggby/CountWhereTest.java @@ -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"); + } + +} diff --git a/src/it/java/io/deephaven/benchmark/tests/standard/updateby/CumCountWhereTest.java b/src/it/java/io/deephaven/benchmark/tests/standard/updateby/CumCountWhereTest.java new file mode 100644 index 00000000..314ba182 --- /dev/null +++ b/src/it/java/io/deephaven/benchmark/tests/standard/updateby/CumCountWhereTest.java @@ -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"); + } + +} diff --git a/src/it/java/io/deephaven/benchmark/tests/standard/updateby/RollingCountWhereTickTest.java b/src/it/java/io/deephaven/benchmark/tests/standard/updateby/RollingCountWhereTickTest.java new file mode 100644 index 00000000..f601c482 --- /dev/null +++ b/src/it/java/io/deephaven/benchmark/tests/standard/updateby/RollingCountWhereTickTest.java @@ -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. + *

+ * Note: This test must contain benchmarks and rev_ticks/fwd_ticks that are comparable to + * RollingCountWhereTimeTest + */ +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"); + } + +} diff --git a/src/it/java/io/deephaven/benchmark/tests/standard/updateby/RollingCountWhereTimeTest.java b/src/it/java/io/deephaven/benchmark/tests/standard/updateby/RollingCountWhereTimeTest.java new file mode 100644 index 00000000..205f604e --- /dev/null +++ b/src/it/java/io/deephaven/benchmark/tests/standard/updateby/RollingCountWhereTimeTest.java @@ -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. + *

+ * Note: This test must contain benchmarks and rev_time/fwd_time that are comparable to + * RollingCountWhereTickTest + */ +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"); + } + +} diff --git a/src/main/resources/io/deephaven/benchmark/run/profile/queries/publish.py b/src/main/resources/io/deephaven/benchmark/run/profile/queries/publish.py index 7a13ef0f..981e6fcd 100644 --- a/src/main/resources/io/deephaven/benchmark/run/profile/queries/publish.py +++ b/src/main/resources/io/deephaven/benchmark/run/profile/queries/publish.py @@ -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())