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

Function getEffectiveRowPolicyFilter

src/Planner/PlannerJoinTree.cpp:305–315  ·  view source on GitHub ↗

Returns the effective row policy filter for the table, or nullptr if the table has no row policies for the current user or the combined filter is always-true. Mirrors the effective-filter check used by buildRowPolicyFilterIfNeeded.

Source from the content-addressed store, hash-verified

303/// always-true. Mirrors the effective-filter check used by
304/// buildRowPolicyFilterIfNeeded.
305RowPolicyFilterPtr getEffectiveRowPolicyFilter(const StoragePtr & storage, const ContextPtr & query_context)
306{
307 auto storage_id = storage->getStorageID();
308 if (!storage_id.hasDatabase())
309 return nullptr;
310 auto row_policy_filter = query_context->getRowPolicyFilter(
311 storage_id.getDatabaseName(), storage_id.getTableName(), RowPolicyFilterType::SELECT_FILTER);
312 if (!row_policy_filter || row_policy_filter->isAlwaysTrue())
313 return nullptr;
314 return row_policy_filter;
315}
316
317bool applyTrivialCountIfPossible(
318 QueryPlan & query_plan,

Calls 6

hasDatabaseMethod · 0.80
isAlwaysTrueMethod · 0.80
getStorageIDMethod · 0.45
getRowPolicyFilterMethod · 0.45
getDatabaseNameMethod · 0.45
getTableNameMethod · 0.45

Tested by

no test coverage detected