Package org.elasticsearch.xpack.esql.datasources
package org.elasticsearch.xpack.esql.datasources
-
ClassDescriptionSource-operator factory that executes a connector query on a background thread and feeds pages into an
AsyncExternalSourceBufferfor the driver to consume.Thread-safe buffer for async external source data.Source operator that retrieves data from external sources (Iceberg tables, Parquet files, etc.).Dual-mode async factory for creating source operators that read from external storage.Fluent builder forAsyncExternalSourceOperatorFactory.Auto-detecting partition detector that tries Hive-style detection first, then falls back to template-based detection if a path template is configured.A composite split that groups multiple child splits into a single scheduling unit.Per-file value describing how this file's blocks become the query's output blocks: for each output column, the source position in the file's natural-order page (or-1when the file lacks that column), and the cast (if any) the coordinator chose during reconciliation.The single source of truth for how a column's ESQLDataTypeparticipates in the external-source per-column statistics pipeline (harvest, cache classification, warm-path serving, and block construction).The block flavour a served MIN/MAX extremum is materialized into.How a statNumberis normalized to the column's resolved type before it is folded/served.Owns the security round-trip forFROM <dataset>, the companion ofDatasetRewriter: each FROM relation the query reads is dispatched — oneEsqlResolveDatasetActionper relation, with that relation's RAW patterns — so the authorization engine read-authorizes the names (indexreadprivilege) and rejects DLS/FLS-restricted datasets, then narrows wildcard expansion to the authorized abstractions.RewritesFROM <dataset>into the sameUnresolvedExternalRelationtheEXTERNALcommand produces, so both paths converge at the existing resolver + analyzer.Per-relation result ofDatasetRewriter.resolve(java.lang.String[], java.lang.String[], org.elasticsearch.cluster.metadata.ProjectMetadata, org.elasticsearch.cluster.metadata.IndexNameExpressionResolver): the authorized concrete dataset names the relation targets, the concrete non-dataset names resolved from the same pattern (drives heterogeneous-FROMUnionAllbuilding), and the explicitly-named datasets absent from the authorized set (surfaced byDatasetRewriter.rewriteOne(org.elasticsearch.xpack.esql.plan.logical.UnresolvedRelation, org.elasticsearch.cluster.metadata.DatasetMetadata, org.elasticsearch.xpack.esql.datasources.metadata.DataSourceMetadata, org.elasticsearch.xpack.esql.datasources.DatasetRewriter.DatasetResolution, boolean)asUnknown index).Aggregated capability declarations from all registeredDataSourcePlugininstances.Decrypts secret values at the connector boundary.Re-encrypts every stored data-source secret under the active project encryption key on rotation — without it, retiring a key would strand secrets undecryptable.Module that collects all data source implementations from plugins.The read-instructions a declared dataset mapping derives for the data node.Bridges aDatasetMapping(the String-typed, server-side declaration) into the ES|QL currency the external-source resolver speaks:Attributes typed withDataType, plus the logical→physical rename map.Result of a non-strict overlay: the user-facingoutput(declared columns renamed to their logical name and retyped, undeclared columns untouched) and the per-filefileSchemathe reader resolves against the file.Shape-only validation of a dataset'sDatasetMappingat PUT time — no file I/O.Registry forDecompressionCodecimplementations, keyed by extension.Capability marker for aSourceOperatorFactorythat participates in deferred (post-TopN) field extraction.Utilities for copying streamingByteBufferchunks into a pre-sized direct destination.REST-handler capability constants for the ES|QL data source + dataset CRUD API.Contributes theDataSourceEncryptedDataHandlerto the project encryption key rotation coordinator.Classifies a failure raised while reading an external data source into the exception theAsyncExternalSourceOperatorshould surface, so that it maps to the right HTTP status.Page-mapping operator that materializes deferred ("wide") columns for the rows surviving a per-driver TopN.BuildsExternalFieldExtractOperators for each driver.Per-driver counters forExternalFieldExtractOperator, surfaced as the operator'sstatusin the profile: pages processed, rows whose deferred columns were materialized, and wall time inmaterialize(...).Registry of the standard ES index metadata names (_id,_index,_version, ...) that the external-source pipeline knows how to materialise on external datasets.Per-page composition of the_idmetadata column for external datasets.Coordinator-only carrier for the four-schema-model units (File, Unified, Query, Per-file Query — seeSchemaReconciliation) inside the datasources subsystem.Thread-safe queue ofExternalSplitinstances for parallel external source execution.Utility for draining pages from aCloseableIteratorinto anAsyncExternalSourceBufferwith non-blocking backpressure.Extended interface for external data source metadata.Deprecated.Holds the result of external source resolution (Iceberg/Parquet metadata).Resolver for external data sources (Iceberg tables, Parquet files, etc.).Cluster settings for controlling ESQL external source behavior; all node-scoped.Detects which external relations are read by a query shape that needs eager global statistics aggregated across all files of a multi-file glob during planning.Registry of well-known file metadata virtual columns for external data sources.Represents a byte range within a file for a file-based external source.DefaultSplitProviderfor file-based sources.Format-agnostic utility for adapting pushed filter expressions to a specific file's column set.Reorders filter conjuncts by estimated selectivity and cost using column statistics from source metadata.Single source of truth for resolving format names from EXTERNAL query configuration.Registry for FormatReader implementations, keyed by format name and file extension.Detects Hive-style partition columns from file paths (e.g.,/year=2024/month=06/file.parquet).Enforces theesql.datasource.local_allowed_pathsallowlist gate forfile://external sources.Lazily merges statistics from a list of childSplitStatsinstances.Registry for source operator factories.Coordinates parallel parsing of a single file by splitting it into byte-range segments and dispatching each segment to a parser thread.Configuration for partition detection strategy, parsed from WITH clause parameters.Pluggable strategy for detecting partition columns from file paths.Walks an unresolved logical plan extracting simple filter predicates fromFilternodes aboveUnresolvedExternalRelationnodes.Holds partition information detected from file paths.Single source of truth for the declared-schema logical→physical column rename (path).Schema reconciliation algorithms for multi-file external sources.Per-file schema information collected during reconciliation.Result of schema reconciliation during planning.Driver-scoped lookup table of per-fileColumnExtractors, addressed by a compactintid allocated at registration time.Serializes and deserializesSourceStatisticsto/from a flatMap<String, Object>using well-known keys.Groups many smallExternalSplits intoCoalescedSplits to reduce scheduling overhead.Walks the physical plan tree, discovers splits for eachExternalSourceExec, and replaces them with split-enriched copies viaExternalSourceExec.withSplits(java.util.List<org.elasticsearch.xpack.esql.datasources.spi.ExternalSplit>).Post-prune "scanned" accounting collected while resolving splits, surfaced at the root of the query profile.Compact representation of per-split (row-group/stripe) statistics with path-segment dictionary compression.Builder for constructingSplitStatsinstances.Type-normalizing comparator for column-statistic values (min/max) against query literals.Metadata about an object returned from directory listing.Iterator over objects in a directory.Format-agnostic manager for creating StorageObject instances from paths.Registry for StorageProvider implementations, keyed by URI scheme.Coordinates parallel parsing of a sequential (non-seekable) decompressed stream by chunking it at record boundaries and dispatching each chunk to a parser thread.Bundles the two independent, easily-confused warning relays a streaming parallel read may need to thread onto worker threads, as a single typed parameter — two bare adjacentConsumer<String>parameters/fields invite silent transposition at a call site.Producer-side composition of the_sourcemetadata column for external datasets.Helpers for reader-synthesized internal channels — columns with no backing source field, filled by the format reader from a per-format value source.Registry of reader-synthesized internal channels.Detects partition columns from bare directory segments using a path template.Aggregate-pushdown opt-in for the line-oriented text-format readers (CSV / TSV / NDJSON).
AsyncExternalSourceOperatorFactory.