public class VariantSchema extends Object implements VariantMetadata
| Constructor and Description |
|---|
VariantSchema() |
| Modifier and Type | Method and Description |
|---|---|
void |
addList(VariantColumnMetadata listCol) |
void |
addMap(MapColumnMetadata mapCol) |
void |
addType(ColumnMetadata col)
Add a column for any supported type to the variant.
|
ColumnMetadata |
addType(MaterializedField field) |
ColumnMetadata |
addType(TypeProtos.MinorType type)
Add any supported type to the variant.
|
void |
becomeSimple() |
protected void |
bind(VariantColumnMetadata parent) |
VariantSchema |
cloneEmpty() |
VariantSchema |
copy() |
boolean |
hasType(TypeProtos.MinorType type)
Determine if the given type is a member of the variant.
|
boolean |
isEquivalent(VariantSchema other) |
boolean |
isSimple() |
boolean |
isSingleType()
A list is defined as a list of variants at the metadata layer.
|
ColumnMetadata |
listSubtype()
Lists are odd creatures: they contain a union if they have more
than one subtype, but are like a nullable repeated type if they
contain only one type.
|
ColumnMetadata |
member(TypeProtos.MinorType type)
Retrieve the virtual column for a given type.
|
static ColumnMetadata |
memberMetadata(TypeProtos.MinorType type) |
Collection<ColumnMetadata> |
members() |
ColumnMetadata |
parent()
Return the column that defines this variant structure
|
int |
size()
Returns the number of types in the variant.
|
String |
toString() |
Collection<TypeProtos.MinorType> |
types()
Returns the list of types which are members of this variant.
|
protected void bind(VariantColumnMetadata parent)
public static ColumnMetadata memberMetadata(TypeProtos.MinorType type)
public ColumnMetadata addType(TypeProtos.MinorType type)
VariantMetadataAt present, the union vector does not support the decimal types. This class does not reject such types; but they will cause a runtime exception when code asks the union vector for these types.
addType in interface VariantMetadatatype - type to addpublic void addType(ColumnMetadata col)
VariantMetadataaddType in interface VariantMetadatacol - column to add. The column must have the correct
mode. The column's type is used as the type keypublic int size()
VariantMetadatasize in interface VariantMetadatapublic boolean hasType(TypeProtos.MinorType type)
VariantMetadatahasType in interface VariantMetadatatype - type to checkpublic ColumnMetadata member(TypeProtos.MinorType type)
VariantMetadatamember in interface VariantMetadatatype - the type keypublic ColumnMetadata parent()
VariantMetadataparent in interface VariantMetadatavariantSchema()
methodpublic Collection<TypeProtos.MinorType> types()
VariantMetadatatypes in interface VariantMetadatapublic Collection<ColumnMetadata> members()
members in interface VariantMetadatapublic void addMap(MapColumnMetadata mapCol)
public void addList(VariantColumnMetadata listCol)
public ColumnMetadata addType(MaterializedField field)
public boolean isSingleType()
VariantMetadataisSingleType in interface VariantMetadatapublic ColumnMetadata listSubtype()
VariantMetadataVariantMetadata.isSingleType() is true)
or a reference to the synthetic union column nested inside the
list.listSubtype in interface VariantMetadatapublic void becomeSimple()
becomeSimple in interface VariantMetadatapublic boolean isSimple()
isSimple in interface VariantMetadatapublic VariantSchema cloneEmpty()
public VariantSchema copy()
public boolean isEquivalent(VariantSchema other)
Copyright © 2021 The Apache Software Foundation. All rights reserved.