Class SchemaReconciliation.ColumnMapping
- All Implemented Interfaces:
Writeable
- Enclosing class:
SchemaReconciliation
DataType references) and wire
serialization (via Writeable), so there is no separate "wire" class.
Cast types are serialized via StreamOutput.writeEnum(E)/StreamInput.readEnum(java.lang.Class<E>)
(ordinal-based). The ordinal mapping is pinned by an assertEnumSerialization test
so any reordering or insertion is caught at test time.
Coordinator sharing: FileSplitProvider passes the same instance
to all splits from the same file. A dedup cache ensures files with content-equal
mappings share a single object. Duplication only occurs during wire serialization.
Wire-size analysis: for a file split into K chunks with N unified columns,
the overhead is K * (4*N + N) bytes when casts are present (one VInt ordinal
per cast), or K * 4*N when no casts are needed. For typical schemas
(N < 200) and split counts (K < 50), this is well under 50 KB total — negligible
next to the data payload. See CoalescedSplit for approaches to eliminate
per-split duplication on the wire for very wide schemas.
Bitset alternative: the int[] currently encodes both "missing" (-1)
and "local index" for present columns. A bitset could represent missing-column flags
in ceil(N/8) bytes and store only the present-column indices, saving ~50% on
the int[] for schemas where most columns are absent. This trade-off only matters for
very wide schemas and is left as a future optimisation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported widening cast targets.Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncast(int globalIndex) intbooleanbooleanhasCasts()inthashCode()booleanbooleanintlocalIndex(int globalIndex) voidwriteTo(StreamOutput out)
-
Constructor Details
-
ColumnMapping
-
ColumnMapping
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
columnCount
public int columnCount() -
localIndex
public int localIndex(int globalIndex) -
cast
-
hasMissingColumns
public boolean hasMissingColumns() -
hasCasts
public boolean hasCasts() -
isIdentity
public boolean isIdentity() -
equals
-
hashCode
public int hashCode()
-