MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / validateNumElementsInArray

Function validateNumElementsInArray

src/function/cast_from_string_functions.cpp:377–384  ·  view source on GitHub ↗

---------------------- cast String to Array Helper ------------------------------ //

Source from the content-addressed store, hash-verified

375
376// ---------------------- cast String to Array Helper ------------------------------ //
377static void validateNumElementsInArray(uint64_t numElementsRead, const LogicalType& type) {
378 auto numElementsInArray = ArrayType::getNumElements(type);
379 if (numElementsRead != numElementsInArray) {
380 throw ConversionException(std::format(
381 "Each array should have fixed number of elements. Expected: {}, Actual: {}.",
382 numElementsInArray, numElementsRead));
383 }
384}
385
386// ---------------------- cast String to List/Array ------------------------------ //
387template<>

Callers 1

castMethod · 0.85

Calls 1

getNumElementsFunction · 0.85

Tested by

no test coverage detected