mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
invalid values handler
This commit is contained in:
parent
0418f179dc
commit
8c4f04c452
@ -18,6 +18,7 @@
|
|||||||
|
|
||||||
#include <AggregateFunctions/IAggregateFunction.h>
|
#include <AggregateFunctions/IAggregateFunction.h>
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ namespace DB
|
|||||||
namespace ErrorCodes
|
namespace ErrorCodes
|
||||||
{
|
{
|
||||||
extern const int TOO_LARGE_ARRAY_SIZE;
|
extern const int TOO_LARGE_ARRAY_SIZE;
|
||||||
|
extern const int INCORRECT_DATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -206,6 +208,11 @@ public:
|
|||||||
|
|
||||||
void add(Mean value, Weight weight, UInt32 max_bins)
|
void add(Mean value, Weight weight, UInt32 max_bins)
|
||||||
{
|
{
|
||||||
|
// nans break sort and compression
|
||||||
|
// infs don't fit in bins partition method
|
||||||
|
if (isnan(value) || isinf(value))
|
||||||
|
throw Exception("invalid value for aggregation", ErrorCodes::INCORRECT_DATA);
|
||||||
|
|
||||||
points[size] = {value, weight};
|
points[size] = {value, weight};
|
||||||
++size;
|
++size;
|
||||||
lower_bound = std::min(lower_bound, value);
|
lower_bound = std::min(lower_bound, value);
|
||||||
|
Loading…
Reference in New Issue
Block a user