check for validity of h3 index

This commit is contained in:
Bharat Nallan Chakravarthy 2022-05-25 06:17:15 +05:30
parent 6e49b76cfd
commit 57cfc0bd04
2 changed files with 8 additions and 0 deletions

View File

@ -92,6 +92,12 @@ public:
{
const UInt64 origin = data_hindex_origin[row];
const UInt64 dest = data_hindex_dest[row];
if (!isValidCell(origin))
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Invalid origin H3 index: {}", origin);
if (!isValidCell(dest))
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Invalid dest H3 index: {}", dest);
UInt64 res = getUnidirectionalEdge(origin, dest);
dst_data[row] = res;
}

View File

@ -21,3 +21,5 @@ select h3GetUnidirectionalEdge(stringToH3('85283473fffffff'), stringToH3('852834
SELECT h3UnidirectionalEdgeIsValid(1248204388774707199) as edge;
SELECT h3UnidirectionalEdgeIsValid(1248204388774707197) as edge;
SELECT h3GetUnidirectionalEdge(stringToH3('85283473ffffff'), stringToH3('852\03477fffffff')), NULL, NULL; -- { serverError 43 }