check max H3 resolution

This commit is contained in:
bharatnc 2022-01-14 00:10:18 -08:00
parent a680604335
commit f0bffbfee5

View File

@ -69,7 +69,12 @@ public:
for (size_t row = 0; row < input_rows_count; ++row)
{
const UInt64 resolution = data[row];
const int resolution = data[row];
if (resolution > MAX_H3_RES)
throw Exception(
ErrorCodes::ARGUMENT_OUT_OF_BOUND,
"The argument 'resolution' ({}) of function {} is out of bounds because the maximum resolution in H3 library is ",
resolution, getName(), MAX_H3_RES);
Float64 res = getNumCells(resolution);
dst_data[row] = res;
}