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

Function getParameterizedViewInnerQuery

src/Analyzer/TableNode.cpp:46–55  ·  view source on GitHub ↗

Each call to a parameterized view with a different set of argument values produces a fresh `StorageView` that carries the substituted inner query but shares the original `StorageID`. Return that substituted query so callers can distinguish such storages by content.

Source from the content-addressed store, hash-verified

44/// `StorageView` that carries the substituted inner query but shares the original `StorageID`.
45/// Return that substituted query so callers can distinguish such storages by content.
46ASTPtr getParameterizedViewInnerQuery(const StoragePtr & storage)
47{
48 if (!storage)
49 return nullptr;
50 auto * view = storage->as<StorageView>();
51 if (!view || !view->isParameterizedView())
52 return nullptr;
53 auto metadata_snapshot = view->getInMemoryMetadataPtr(nullptr, false);
54 return metadata_snapshot->getSelectQuery().inner_query;
55}
56
57}
58

Callers 2

isEqualImplMethod · 0.85
updateTreeHashImplMethod · 0.85

Calls 3

isParameterizedViewMethod · 0.45
getSelectQueryMethod · 0.45

Tested by

no test coverage detected