Class ExternalRelation

All Implemented Interfaces:
NamedWriteable, Writeable, Resolvable, ExecutesOn, ExecutesOn.Coordinator

public class ExternalRelation extends LeafPlan implements ExecutesOn.Coordinator
Logical plan node for external data source relations (e.g., Iceberg table, Parquet file).

Like EsRelation, the Mapper wraps this into a FragmentExec so that pipeline breakers (Aggregate, Limit, TopN) above it are distributed to data nodes via ExchangeExec. On data nodes, localPlan() expands the FragmentExec through LocalMapper into ExternalSourceExec, enabling local optimizations such as filter pushdown via FilterPushdownRegistry.

The ExecutesOn.Coordinator marker is retained for logical plan validation (e.g., Enrich/Join hoist rules that inspect whether a relation executes on the coordinator).

The source-specific metadata is stored in the SourceMetadata interface, which provides:

The toPhysicalExec() method creates a generic ExternalSourceExec that carries all necessary information for the operator factory to create the appropriate source operator via the SPI.