MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / matchTablePrefix

Function matchTablePrefix

src/Processors/QueryPlan/QueryPlanFormat.cpp:44–54  ·  view source on GitHub ↗

Matches `__table .` at position pos, returns the position after the dot or 0 on mismatch.

Source from the content-addressed store, hash-verified

42
43 /// Matches `__table<digits>.` at position pos, returns the position after the dot or 0 on mismatch.
44 static size_t matchTablePrefix(std::string_view name, size_t pos)
45 {
46 if (!name.substr(pos).starts_with(TABLE_PREFIX))
47 return 0;
48 size_t j = pos + TABLE_PREFIX.size();
49 while (j < name.size() && std::isdigit(static_cast<unsigned char>(name[j])))
50 ++j;
51 if (j > pos + TABLE_PREFIX.size() && j < name.size() && name[j] == '.')
52 return j + 1;
53 return 0;
54 }
55
56 String trimColumnIdentifier(std::string_view name)
57 {

Callers 1

trimColumnIdentifierFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected