Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement
AggCountWhere
to support generic counting using `Fi…
…lter` (deephaven#6497) ## Groovy Examples ``` Table countTable = table.aggBy(List.of( AggCountWhere("filter1", "intCol >= 50"), AggCountWhere("filter2", "intCol >= 50", "intCol != 80"), AggCountWhere("filter3", Filter.or(Filter.from("intCol >= 50", "intCol == 3"))), AggCountWhere("filter4", "true"), AggCountWhere("filter5", "false"), AggCountWhere("filter6", "intCol % 2 == 0"), AggCountWhere("filter7", Filter.and(Filter.or(Filter.from("false", "intCol % 3 == 0")), Filter.or(Filter.from("false", "intCol % 2 == 0")))), AggCountWhere("filter8", "intCol % 2 == 0", "intCol % 3 == 0"), AggCountWhere("filter9", Filter.and(Filter.and(Filter.from("intCol > 0")), Filter.and(Filter.from("intCol <= 10", "intCol >= 5")))), // Multiple input columns AggCountWhere("filter10", "intCol >= 5", "doubleCol <= 10.0"), AggCountWhere("filter11", "intCol >= 5 && intColNulls != 3 && doubleCol <= 10.0"), // DynamicWhereFilter AggCountWhere("filter12", new DynamicWhereFilter(setTable, true, MatchPairFactory.getExpressions("intCol")))), "Sym").sort("Sym"); ``` ## Python Examples ``` from deephaven import empty_table from deephaven.agg import count_where table_size = 120000000 table = empty_table(table_size).update(["int1M=randomInt(0,1000000)", "int640=randomInt(0,640)", "int250=randomInt(0,250)"]).select() # zero-key t_count = table.agg_by(aggs=count_where(col="count", filters=["int1M < 500000", "int1M > 499000"])) # bucketed t_count = table.agg_by(aggs=count_where(col="count", filters=["int1M < 500000", "int1M > 499000"]), by="int250") ```
- Loading branch information