Class UnresolvedExternalRelation
- All Implemented Interfaces:
NamedWriteable,Writeable,Resolvable,Unresolvable,UnresolvedSourceRelation
EXTERNAL commands and by the dataset rewriter for FROM <dataset>; both
paths converge here so the downstream resolver/analyzer treat them uniformly.
The config map holds plain configuration values (no Literal wrappers); secret values arrive as
SecureString on the dataset path.
- See Also:
-
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.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from class org.elasticsearch.xpack.esql.core.tree.Node
TO_STRING_MAX_LINES, TO_STRING_MAX_WIDTHFields inherited from interface org.elasticsearch.xpack.esql.core.capabilities.Unresolvable
UNRESOLVED_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionUnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config) Creates an unresolved external relation with no METADATA fields.UnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config, List<NamedExpression> metadataFields) Creates an unresolved external relation without a backing dataset name (the inlineEXTERNALcommand path or tests that exercise the analyzer with a bare path).UnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config, List<NamedExpression> metadataFields, String datasetName) Creates an unresolved external relation.UnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config, List<NamedExpression> metadataFields, String datasetName, DatasetMapping mapping) Full constructor carrying the dataset's user-declared mapping (DatasetMapping), if any. -
Method Summary
Modifier and TypeMethodDescriptionconfig()Registered dataset identifier, ornullwhen this relation was produced by the inlineEXTERNALcommand path (no dataset mapping).booleanbooleaninthashCode()protected NodeInfo<UnresolvedExternalRelation> info()Normally, you want to use one of the staticcreatemethods to implement this.mapping()The dataset's user-declared mapping (the `mappings` block), ornullwhen the dataset has none (inference only) or for the inlineEXTERNALpath.The values of all the properties that are important to thisNode.output()The ordered list of attributes (i.e.booleanresolved()toString()NOTE: Any non-null return value from this method indicates that the item in question could not be resolved.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, 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, nodeString, nodeString, propertiesToString, replaceChildrenSameSize, source, sourceLocation, sourceText, toString, toString, transformChildren, transformChildren, transformDown, transformDown, transformDown, transformDown, transformDownSkipBranch, transformNodeProps, transformPropertiesDown, transformPropertiesOnly, transformPropertiesUp, transformUp, transformUp, transformUp
-
Constructor Details
-
UnresolvedExternalRelation
Creates an unresolved external relation with no METADATA fields. Convenience overload for callers that don't carry standard metadata names (the inlineEXTERNALcommand path, tests). -
UnresolvedExternalRelation
public UnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config, List<NamedExpression> metadataFields) Creates an unresolved external relation without a backing dataset name (the inlineEXTERNALcommand path or tests that exercise the analyzer with a bare path). -
UnresolvedExternalRelation
public UnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config, List<NamedExpression> metadataFields, @Nullable String datasetName) Creates an unresolved external relation.The
metadataFieldslist carries the names from the user'sMETADATA ...clause verbatim. The analyzer (specificallyResolveExternalRelations) is the binding site: it resolves each name againstMetadataAttribute.ATTRIBUTES_MAPand appends anExternalMetadataAttributeper resolved name to the leaf's output. This constructor does not validate the names — invalid names surface as unresolved attributes downstream with the existing "Unknown column" diagnostic.datasetNameis the registered dataset identifier when the relation was created byDatasetRewriterfrom aFROM <dataset>pattern; it isnullfor the inlineEXTERNALcommand path where no dataset mapping exists. It flows through to the operator factory so the per-file_indexsynthesizer can populate the column with the user-facing dataset identifier rather than the raw resource path.- Parameters:
source- the source location in the querytablePath- the resource path or external table identifier (aLiteralor parameter reference)config- plain-valued configuration (e.g., credentials, format options) — not wrapped inLiteralmetadataFields- names requested in theMETADATAclause, in declaration order; nevernulldatasetName- registered dataset name when this leaf came fromFROM <dataset>;nullotherwise
-
UnresolvedExternalRelation
public UnresolvedExternalRelation(Source source, Expression tablePath, Map<String, Object> config, List<NamedExpression> metadataFields, @Nullable String datasetName, @Nullable DatasetMapping mapping) Full constructor carrying the dataset's user-declared mapping (DatasetMapping), if any. Only theFROM <dataset>path (viaDatasetRewriter) supplies a non-null mapping; the inlineEXTERNALpath and tests passnull(inference only). The mapping is consumed in pre-analysis by the external-source resolver to drive the strict-skip / non-strict-overlay decision.
-
-
Method Details
-
writeTo
-
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>
-
tablePath
-
config
-
metadataFields
-
datasetName
Registered dataset identifier, ornullwhen this relation was produced by the inlineEXTERNALcommand path (no dataset mapping). Threaded to the operator factory so the_indexper-file synthesizer can emit the user-facing dataset name. -
mapping
The dataset's user-declared mapping (the `mappings` block), ornullwhen the dataset has none (inference only) or for the inlineEXTERNALpath. Consumed by the external-source resolver. -
resolved
public boolean resolved()- Specified by:
resolvedin interfaceResolvable- Specified by:
resolvedin interfaceUnresolvable- Overrides:
resolvedin classLogicalPlan
-
expressionsResolved
public boolean expressionsResolved()- Specified by:
expressionsResolvedin classLogicalPlan
-
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>
-
unresolvedMessage
Description copied from interface:UnresolvableNOTE: Any non-null return value from this method indicates that the item in question could not be resolved.- Specified by:
unresolvedMessagein interfaceUnresolvable
-
hashCode
public int hashCode()- Specified by:
hashCodein classLogicalPlan
-
equals
- Specified by:
equalsin classLogicalPlan
-
nodeProperties
Description copied from class:NodeThe values of all the properties that are important to thisNode.- Overrides:
nodePropertiesin classNode<LogicalPlan>
-
toString
- Overrides:
toStringin classNode<LogicalPlan>
-