This commit is contained in:
taiyang-li 2023-02-22 10:08:21 +08:00
parent ec81d2f426
commit 68bc4f2cb6
2 changed files with 5 additions and 5 deletions

View File

@ -84,14 +84,14 @@ public:
, argument_type(this->argument_types[0])
{
if (!returns_many && levels.size() > 1)
throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function {} require one level parameter or less", getName());
throw Exception(ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH, "Aggregate function {} requires one level parameter or less", getName());
if constexpr (is_quantile_gk)
{
const auto & accuracy_field = params[0];
if (!isInt64OrUInt64FieldType(accuracy_field.getType()))
throw Exception(
ErrorCodes::LOGICAL_ERROR, "Aggregate function {} require accuracy parameter with integer type", getName());
ErrorCodes::LOGICAL_ERROR, "Aggregate function {} requires accuracy parameter with integer type", getName());
if (accuracy_field.getType() == Field::Types::Int64)
accuracy = accuracy_field.get<Int64>();
@ -101,7 +101,7 @@ public:
if (accuracy <= 0)
throw Exception(
ErrorCodes::LOGICAL_ERROR,
"Aggregate function {} require accuracy parameter with positive value but is {}",
"Aggregate function {} requires accuracy parameter with positive value but is {}",
getName(),
accuracy);
}

View File

@ -73,7 +73,7 @@ public:
}
}
void query(const Float64 * percentiles, const size_t * indices, size_t size, T * result)
void query(const Float64 * percentiles, const size_t * indices, size_t size, T * result) const
{
if (!head_sampled.empty())
throw Exception(ErrorCodes::LOGICAL_ERROR, "Cannot operate on an uncompressed summary, call compress() first");
@ -266,7 +266,7 @@ public:
}
private:
QueryResult findApproxQuantile(size_t index, Int64 min_rank_at_index, double target_error, double percentile)
QueryResult findApproxQuantile(size_t index, Int64 min_rank_at_index, double target_error, double percentile) const
{
Stats curr_sample = sampled[index];
Int64 rank = static_cast<Int64>(std::ceil(percentile * count));