Class ExternalRelation
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,ExecutesOn,ExecutesOn.Coordinator
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:
- Schema attributes via
SourceMetadata.schema() - Source type via
SourceMetadata.sourceType() - Configuration via
SourceMetadata.config() - Opaque source metadata via
SourceMetadata.sourceMetadata()
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
LogicalPlan.StageNested classes/interfaces inherited from class org.elasticsearch.xpack.esql.core.tree.Node
Node.NodeStringFormatNested classes/interfaces inherited from interface org.elasticsearch.xpack.esql.plan.logical.ExecutesOn
ExecutesOn.Coordinator, ExecutesOn.ExecuteLocation, ExecutesOn.RemoteNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionExternalRelation(Source source, String sourcePath, SourceMetadata metadata, List<Attribute> output) ExternalRelation(Source source, String sourcePath, SourceMetadata metadata, List<Attribute> output, FileList fileList) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanfileList()inthashCode()protected NodeInfo<ExternalRelation> info()Normally, you want to use one of the staticcreatemethods to implement this.metadata()voidnodeString(StringBuilder sb, Node.NodeStringFormat format) Append thisNode's string representation tosb.output()The ordered list of attributes (i.e.withAttributes(List<Attribute> newAttributes) voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.xpack.esql.plan.logical.LeafPlan
computeReferences, replaceChildrenMethods inherited from class org.elasticsearch.xpack.esql.plan.logical.LogicalPlan
analyzed, childrenResolved, optimized, preAnalyzed, preOptimized, resolved, setAnalyzed, setOptimized, setPreAnalyzed, setPreOptimizedMethods inherited from class org.elasticsearch.xpack.esql.plan.QueryPlan
computeExpressions, expressions, forEachExpression, forEachExpression, forEachExpressionDown, forEachExpressionUp, inputSet, outputSet, references, transformExpressionsDown, transformExpressionsDown, transformExpressionsOnly, transformExpressionsOnly, transformExpressionsOnlyUp, transformExpressionsUp, transformExpressionsUpMethods inherited from class org.elasticsearch.xpack.esql.core.tree.Node
allMatch, anyMatch, children, collect, collect, collect, collectFirstChildren, collectLeaves, doCollectFirst, forEachDown, forEachDown, forEachDownMayReturnEarly, forEachProperty, forEachPropertyDown, forEachPropertyOnly, forEachPropertyUp, forEachUp, forEachUp, nodeName, nodeProperties, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUpMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xpack.esql.plan.logical.ExecutesOn.Coordinator
executesOn
-
Field Details
-
ENTRY
-
-
Constructor Details
-
ExternalRelation
-
ExternalRelation
public ExternalRelation(Source source, String sourcePath, SourceMetadata metadata, List<Attribute> output)
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable
-
info
Description copied from class:NodeNormally, you want to use one of the staticcreatemethods to implement this.For
QueryPlans, it is very important that the properties contain all of the expressions and references relevant to this node, and that all the properties are used in the provided constructor; otherwise query plan transformations likeQueryPlan#transformExpressionsOnly(Function)will not have an effect.- Specified by:
infoin classNode<LogicalPlan>
-
sourcePath
-
metadata
-
fileList
-
output
Description copied from class:QueryPlanThe ordered list of attributes (i.e. columns) this plan produces when executed. Must be called only on resolved plans, otherwise may throw an exception or return wrong results.- Specified by:
outputin classQueryPlan<LogicalPlan>
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
sourceType
-
toPhysicalExec
-
hashCode
public int hashCode()- Specified by:
hashCodein classLogicalPlan
-
equals
- Specified by:
equalsin classLogicalPlan
-
nodeString
Description copied from class:Node- Overrides:
nodeStringin classNode<LogicalPlan>- Parameters:
sb- target for the stringformat- configuration for rendering the string representation
-
withAttributes
-