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

Method updateTreeHashImpl

src/Analyzer/TableNode.cpp:172–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

170}
171
172void TableNode::updateTreeHashImpl(HashState & state, CompareOptions) const
173{
174 if (!temporary_table_name.empty())
175 {
176 state.update(temporary_table_name.size());
177 state.update(temporary_table_name);
178 }
179 else
180 {
181 // In case of cross-replication we don't know what database is used for the table.
182 // `storage_id.hasDatabase()` can return false only on the initiator node.
183 // Each shard will use the default database (in the case of cross-replication shards may have different defaults).
184 auto full_name = storage_id.hasDatabase() ? storage_id.getFullNameNotQuoted() : storage_id.getTableName();
185 state.update(full_name.size());
186 state.update(full_name);
187 }
188
189 if (table_expression_modifiers)
190 table_expression_modifiers->updateTreeHash(state);
191
192 /// See note in `isEqualImpl`: parameterized-view calls reuse the same `StorageID`, so we mix in
193 /// the substituted inner query to keep distinct argument values hashing to distinct values.
194 if (auto inner_query = getParameterizedViewInnerQuery(storage))
195 inner_query->updateTreeHash(state, /*ignore_aliases=*/false);
196}
197
198QueryTreeNodePtr TableNode::cloneImpl() const
199{

Callers

nothing calls this directly

Calls 8

hasDatabaseMethod · 0.80
getFullNameNotQuotedMethod · 0.80
emptyMethod · 0.45
updateMethod · 0.45
sizeMethod · 0.45
getTableNameMethod · 0.45
updateTreeHashMethod · 0.45

Tested by

no test coverage detected