MCPcopy Create free account
hub / github.com/ByConity/ByConity / checkObjectHasNoAmbiguousPaths

Function checkObjectHasNoAmbiguousPaths

src/DataTypes/ObjectUtils.cpp:295–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295void checkObjectHasNoAmbiguousPaths(const PathsInData & paths)
296{
297 size_t size = paths.size();
298 for (size_t i = 0; i < size; ++i)
299 {
300 for (size_t j = 0; j < i; ++j)
301 {
302 if (isPrefix(paths[i].getParts(), paths[j].getParts())
303 || isPrefix(paths[j].getParts(), paths[i].getParts()))
304 throw Exception(ErrorCodes::INCOMPATIBLE_COLUMNS,
305 "Data in Object has ambiguous paths: '{}' and '{}'",
306 paths[i].getPath(), paths[j].getPath());
307
308 if (hasDifferentStructureInPrefix(paths[i].getParts(), paths[j].getParts()))
309 throw Exception(ErrorCodes::INCOMPATIBLE_COLUMNS,
310 "Data in Object has ambiguous paths: '{}' and '{}'. "
311 "Paths have prefixes matched by names, but different in structure",
312 paths[i].getPath(), paths[j].getPath());
313 }
314 }
315}
316
317static DataTypePtr getLeastCommonTypeForObject(const DataTypes & types, bool check_ambiguous_paths)
318{

Callers 2

finalizeMethod · 0.85

Calls 6

isPrefixFunction · 0.70
ExceptionClass · 0.50
sizeMethod · 0.45
getPartsMethod · 0.45
getPathMethod · 0.45

Tested by

no test coverage detected