public class MutableTupleSchema extends Object
Does not implement the TupleMetadata
interface because that interface
has far more functionality than is needed here, and assumes that column order
remains fixed (and hence columns can be addressed by position) which is not
true for this class.
This class represents the top-level tuple (the row.) Maps are also dynamic, but provide a subset of resolution options: map fields cannot be implicit. They can, however, be defined, provided, discovered or missing. Map columns can start unresolved if the map comes from projection. A map itself can be resolved, but its members may be unresolved. New map members may only be added at the end (there is no equivalent of a wildcard position.)
Modifier and Type | Class and Description |
---|---|
static class |
MutableTupleSchema.ColumnHandle
Holder for a column to allow inserting and replacing columns within
the top-level project list.
|
Modifier and Type | Field and Description |
---|---|
protected List<MutableTupleSchema.ColumnHandle> |
columns |
protected Map<String,MutableTupleSchema.ColumnHandle> |
nameIndex |
Constructor and Description |
---|
MutableTupleSchema() |
protected final List<MutableTupleSchema.ColumnHandle> columns
protected final Map<String,MutableTupleSchema.ColumnHandle> nameIndex
public void setProjectionType(ScanSchemaTracker.ProjectionType type)
public void setInsertPoint(int insertPoint)
public ScanSchemaTracker.ProjectionType projectionType()
public int size()
public int version()
public List<MutableTupleSchema.ColumnHandle> columns()
public MutableTupleSchema.ColumnHandle find(String colName)
public void copyFrom(TupleMetadata from)
public void add(ColumnMetadata col)
public void addIndex(MutableTupleSchema.ColumnHandle holder)
public MutableTupleSchema.ColumnHandle insert(int posn, ColumnMetadata col)
public MutableTupleSchema.ColumnHandle insert(ColumnMetadata col)
public void moveIfExplicit(String colName)
public boolean isResolved()
public TupleMetadata toSchema()
public void resolveImplicit(MutableTupleSchema.ColumnHandle col, ColumnMetadata resolved, ImplicitColumnMarker marker)
public void replace(MutableTupleSchema.ColumnHandle col, ColumnMetadata resolved)
public void resolve(MutableTupleSchema.ColumnHandle col, ColumnMetadata resolved)
public boolean isEmpty()
Copyright © 1970 The Apache Software Foundation. All rights reserved.