summaryrefslogtreecommitdiff
path: root/src/fieldstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fieldstat.c')
-rw-r--r--src/fieldstat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fieldstat.c b/src/fieldstat.c
index 07142a3..a0ccdbb 100644
--- a/src/fieldstat.c
+++ b/src/fieldstat.c
@@ -273,6 +273,13 @@ int fieldstat_register_cube(struct fieldstat *instance, const struct fieldstat_t
shared_tags = NULL;
n_tag = 0;
}
+ if (mode == SAMPLING_MODE_TOPK && max_n_cell == 0) {
+ return -1;
+ }
+ if (max_n_cell == 0) {
+ max_n_cell = INTMAX_MAX;
+ }
+
struct fs_cube *cube = fieldstat_cube_new(shared_tags, n_tag, mode, max_n_cell);
int cube_id = fieldstat_append_cube_to_instance(instance, cube);