params = t_strsplit(*tmp, ":");
if (params[1] == NULL) {
+ /* <field name> - alias for <field>:discrete */
group_by.func = STATS_METRIC_GROUPBY_DISCRETE;
+ } else if (strcmp(params[1], "discrete") == 0) {
+ /* <field>:discrete */
+ group_by.func = STATS_METRIC_GROUPBY_DISCRETE;
+ if (params[2] != NULL) {
+ *error_r = "group_by 'discrete' aggregate function "
+ "does not take any args";
+ return FALSE;
+ }
} else {
*error_r = t_strdup_printf("unknown aggregation function "
"'%s' on field '%s'", params[1], params[0]);
{ "eta", "kappa", "nu", },
{ "upsilon", "pi", "epsilon", },
},
+ {
+ "test_name:discrete sub_name:discrete",
+ 3,
+ { "apple", "bannana", "orange", },
+ { "pie", "yoghurt", "cobbler", },
+ },
+ {
+ "test_name sub_name:discrete",
+ 3,
+ { "apollo", "gaia", "hermes", },
+ { "thor", "odin", "loki", },
+ },
};
static void test_stats_metrics_group_by_discrete_real(const struct discrete_test *test)