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)
VariantMetadata
At 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 VariantMetadata
type
- type to addpublic void addType(ColumnMetadata col)
VariantMetadata
addType
in interface VariantMetadata
col
- column to add. The column must have the correct
mode. The column's type is used as the type keypublic int size()
VariantMetadata
size
in interface VariantMetadata
public boolean hasType(TypeProtos.MinorType type)
VariantMetadata
hasType
in interface VariantMetadata
type
- type to checkpublic ColumnMetadata member(TypeProtos.MinorType type)
VariantMetadata
member
in interface VariantMetadata
type
- the type keypublic ColumnMetadata parent()
VariantMetadata
parent
in interface VariantMetadata
variantSchema()
methodpublic Collection<TypeProtos.MinorType> types()
VariantMetadata
types
in interface VariantMetadata
public Collection<ColumnMetadata> members()
members
in interface VariantMetadata
public void addMap(MapColumnMetadata mapCol)
public void addList(VariantColumnMetadata listCol)
public ColumnMetadata addType(MaterializedField field)
public boolean isSingleType()
VariantMetadata
isSingleType
in interface VariantMetadata
public ColumnMetadata listSubtype()
VariantMetadata
VariantMetadata.isSingleType()
is true)
or a reference to the synthetic union column nested inside the
list.listSubtype
in interface VariantMetadata
public void becomeSimple()
becomeSimple
in interface VariantMetadata
public boolean isSimple()
isSimple
in interface VariantMetadata
public VariantSchema cloneEmpty()
public VariantSchema copy()
public boolean isEquivalent(VariantSchema other)
Copyright © 1970 The Apache Software Foundation. All rights reserved.