Class ExternalSchema
java.lang.Object
org.elasticsearch.xpack.esql.datasources.ExternalSchema
Coordinator-only carrier for the four-schema-model units (File, Unified, Query, Per-file Query —
see
SchemaReconciliation) inside the datasources subsystem. Pairs a positional
List<Attribute> with a name set built eagerly at construction for O(1) membership tests
at the prune / skip / map-filter seams. Not a wire form — schemas that travel across nodes go
through their own paths (post-prune attributes on ExternalSourceExec via the
planner contract, and FileSplit.readSchema via primitive (name, type, nullable)
tuples).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalSchemadataAttributesOf(List<Attribute> attributes) Returns the data-attribute view ofattributesas anExternalSchema: the input list with virtual columns filtered out (relative order preserved).static ExternalSchemadataAttributesOf(List<Attribute> attributes, Set<String> partitionColumnNames) Returns the data-attribute view ofattributesas anExternalSchema: the input list with virtual columns and Hive-style partition columns filtered out (relative order preserved).booleanget(int index) inthashCode()booleanisEmpty()iterator()names()intsize()toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ExternalSchema
-
-
Method Details
-
dataAttributesOf
Returns the data-attribute view ofattributesas anExternalSchema: the input list with virtual columns filtered out (relative order preserved). Equivalent todataAttributesOf(List, Set)with an empty partition-column set; callers that track Hive-style partition columns must use that overload so the resulting width agrees with the file-backedColumnMapping. -
dataAttributesOf
public static ExternalSchema dataAttributesOf(List<Attribute> attributes, Set<String> partitionColumnNames) Returns the data-attribute view ofattributesas anExternalSchema: the input list with virtual columns and Hive-style partition columns filtered out (relative order preserved). Used by external-source operator factories on the data node to derive the data-only schema once at construction rather than re-slicing per page.Two classes of column are excluded because the format reader never produces them in the data channel — both are appended on the producer thread by
VirtualColumnIterator:- Virtual columns (
MetadataAttributefor ES document metadata, anyVirtualAttributefor engine-synthesized columns like_file.*). - Hive-style partition columns — real
ReferenceAttributes whose name is inpartitionColumnNames. Their values are derived from the file path, not the file body. Excluding them keeps the data-only width in agreement with the file-backedColumnMapping; otherwise theSchemaAdaptingIteratorsize-vs-width guard misfires whenever a partition key shadows a same-named physical column (the path-derived value wins and the physical column is hidden, matching Spark and DuckDB).
- Virtual columns (
-
attributes
-
names
-
size
public int size() -
isEmpty
public boolean isEmpty() -
get
-
iterator
-
equals
-
hashCode
public int hashCode() -
toString
-