summaryrefslogtreecommitdiff
path: root/src/cube.c
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2024-10-23 18:13:58 +0800
committerchenzizhan <[email protected]>2024-10-23 18:13:58 +0800
commitb883f51910cf155d99f1aa03847d5dac2e690f1d (patch)
treeca7baf1cb66da5c6c8305699c52f415c2130b8de /src/cube.c
parente4f173ace47806a87274a3f7e8cec180ba3ab11c (diff)
fieldstat_histogram_fork->histogram_new
Diffstat (limited to 'src/cube.c')
-rw-r--r--src/cube.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/cube.c b/src/cube.c
index bafb170..f8a41d5 100644
--- a/src/cube.c
+++ b/src/cube.c
@@ -802,13 +802,18 @@ int cube_histogram_merge(struct cube *cube, int metric_id, const struct field *d
const struct metric_manifest *manifest = metric_manifest_manager_get_by_id(cube->manifest_manager, metric_id);
if (manifest == NULL || manifest->type != METRIC_TYPE_HISTOGRAM) {
- printf("invalid metric id\n");
return FS_ERR_INVALID_METRIC_ID;
}
+ // check if the parameters matches
+ if (src->lowest_discernible_value != manifest->parameters->hdr.lowest_trackable_value ||
+ src->highest_trackable_value != manifest->parameters->hdr.highest_trackable_value ||
+ src->significant_figures != manifest->parameters->hdr.significant_figures) {
+ return FS_ERR_INVALID_PARAM;
+ }
+
struct cell *cell_data = get_cell_in_cube_generic(cube, dimensions, n_dimensions);
if (cell_data == NULL) {
- printf("too many cells\n");
return FS_ERR_TOO_MANY_CELLS;
}