public class TupleSchema extends AbstractPropertied implements TupleMetadata
Modifier and Type | Field and Description |
---|---|
static String |
TYPE |
IS_STRICT_SCHEMA_PROP, READER, WRITER
DRILL_PROP_PREFIX
Constructor and Description |
---|
TupleSchema() |
TupleSchema(List<AbstractColumnMetadata> columns,
Map<String,String> properties) |
Modifier and Type | Method and Description |
---|---|
void |
add(ColumnMetadata md)
Add a column metadata column created by the caller.
|
ColumnMetadata |
add(MaterializedField field)
Add a new column to the schema.
|
int |
addColumn(ColumnMetadata column) |
ColumnMetadata |
addView(MaterializedField field) |
void |
bind(AbstractMapColumnMetadata parentMap) |
MaterializedField |
column(int index) |
MaterializedField |
column(String name) |
TupleSchema |
copy() |
boolean |
equals(Object o) |
String |
fullName() |
String |
fullName(ColumnMetadata column)
Full name of the column.
|
String |
fullName(int index) |
int |
hashCode() |
int |
index(String name) |
boolean |
isEmpty() |
boolean |
isEquivalent(TupleMetadata other) |
boolean |
isRoot() |
Iterator<ColumnMetadata> |
iterator() |
ColumnMetadata |
metadata(int index) |
ColumnMetadata |
metadata(String name) |
AbstractMapColumnMetadata |
parent() |
Map<String,String> |
properties() |
void |
replace(ColumnMetadata replaceWith) |
int |
size() |
List<MaterializedField> |
toFieldList()
Return the schema as a list of MaterializedField objects
which can be used to create other schemas.
|
List<ColumnMetadata> |
toMetadataList()
Returns schema as list of ColumnMetadata objects
which can be used to create JSON schema object.
|
String |
toString() |
booleanProperty, booleanProperty, hasProperties, intProperty, intProperty, property, property, removeProperty, setBooleanProperty, setIntProperty, setProperties, setProperty
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
jsonString, of
booleanProperty, booleanProperty, hasProperties, intProperty, intProperty, pluginPrefix, property, property, removeProperty, setBooleanProperty, setIntProperty, setProperties, setProperty
forEach, spliterator
public static final String TYPE
public TupleSchema()
public TupleSchema(List<AbstractColumnMetadata> columns, Map<String,String> properties)
public void bind(AbstractMapColumnMetadata parentMap)
public TupleSchema copy()
copy
in interface TupleMetadata
public ColumnMetadata add(MaterializedField field)
TupleMetadata
add
in interface TupleMetadata
field
- materialized fieldpublic ColumnMetadata addView(MaterializedField field)
public void add(ColumnMetadata md)
add(MaterializedField)
.md
- the custom column metadata which must have the correct
index set (from size()
public int addColumn(ColumnMetadata column)
addColumn
in interface TupleMetadata
public MaterializedField column(String name)
column
in interface TupleMetadata
public ColumnMetadata metadata(String name)
metadata
in interface TupleMetadata
public int index(String name)
index
in interface TupleMetadata
public MaterializedField column(int index)
column
in interface TupleMetadata
public ColumnMetadata metadata(int index)
metadata
in interface TupleMetadata
public AbstractMapColumnMetadata parent()
parent
in interface TupleMetadata
public int size()
size
in interface TupleMetadata
public boolean isEmpty()
isEmpty
in interface TupleMetadata
public Iterator<ColumnMetadata> iterator()
iterator
in interface Iterable<ColumnMetadata>
public boolean isEquivalent(TupleMetadata other)
isEquivalent
in interface TupleMetadata
public boolean equals(Object o)
equals
in class AbstractPropertied
public int hashCode()
hashCode
in class AbstractPropertied
public List<MaterializedField> toFieldList()
TupleMetadata
toFieldList
in interface TupleMetadata
public List<ColumnMetadata> toMetadataList()
TupleMetadata
toMetadataList
in interface TupleMetadata
public String fullName(int index)
fullName
in interface TupleMetadata
public String fullName(ColumnMetadata column)
TupleMetadata
fullName
in interface TupleMetadata
public String fullName()
public boolean isRoot()
public void replace(ColumnMetadata replaceWith)
replace
in interface TupleMetadata
public Map<String,String> properties()
properties
in interface Propertied
properties
in class AbstractPropertied
Copyright © 1970 The Apache Software Foundation. All rights reserved.