Class DatasetResolver
java.lang.Object
org.elasticsearch.xpack.esql.datasources.DatasetResolver
Owns the security round-trip for
FROM <dataset>, the companion of DatasetRewriter: each FROM relation
the query reads is dispatched — one EsqlResolveDatasetAction per relation, with that relation's RAW patterns —
so the authorization engine read-authorizes the names (index read privilege) and rejects DLS/FLS-restricted
datasets, then narrows wildcard expansion to the authorized abstractions. The per-relation results feed a synchronous
DatasetRewriter.rewrite(org.elasticsearch.xpack.esql.plan.logical.LogicalPlan, org.elasticsearch.cluster.metadata.ProjectMetadata, java.util.Map<org.elasticsearch.xpack.esql.plan.logical.UnresolvedRelation, org.elasticsearch.xpack.esql.datasources.DatasetRewriter.DatasetResolution>, boolean) that turns authorized datasets into external relations.
Per-relation dispatch (rather than one request for the whole plan) is required because exclusion semantics are
per-relation: -logs_test in one FROM must not drop logs_test from a different FROM in the same plan.
Mirrors how ViewResolver routes each UnresolvedRelation's raw patterns through
EsqlResolveViewAction.
When no dataset is registered in cluster state, or no FROM pattern can match a registered dataset, the listener completes synchronously and no request is sent.
-
Constructor Summary
ConstructorsConstructorDescriptionDatasetResolver(Client client, Executor executor, CrossProjectModeDecider crossProjectModeDecider) -
Method Summary
Modifier and TypeMethodDescriptionvoidreplaceDatasets(LogicalPlan parsed, ProjectMetadata projectMetadata, ActionListener<LogicalPlan> listener) Completeslistenerwith the rewritten plan (or the untouched plan when no relation qualifies).
-
Constructor Details
-
DatasetResolver
public DatasetResolver(Client client, Executor executor, CrossProjectModeDecider crossProjectModeDecider)
-
-
Method Details
-
replaceDatasets
public void replaceDatasets(LogicalPlan parsed, ProjectMetadata projectMetadata, ActionListener<LogicalPlan> listener) Completeslistenerwith the rewritten plan (or the untouched plan when no relation qualifies). Authorization failures (DLS/FLS, and theUnknown indexa rewrite raises for an explicit unauthorized dataset) propagate as-is.
-