public class BatchSchema extends Object implements Iterable<MaterializedField>
BatchSchema is used to represent the schema of a batch. However, it does not handle complex types well. If you have a choice, use
TupleMetadata instead.| Modifier and Type | Class and Description |
|---|---|
static class |
BatchSchema.SelectionVectorMode |
| Constructor and Description |
|---|
BatchSchema(BatchSchema.SelectionVectorMode selectionVector,
List<MaterializedField> fields) |
| Modifier and Type | Method and Description |
|---|---|
BatchSchema |
clone() |
boolean |
equals(Object obj)
DRILL-5525: the semantics of this method are badly broken.
|
String |
format()
Format the schema into a multi-line format.
|
MaterializedField |
getColumn(int index) |
int |
getFieldCount() |
BatchSchema.SelectionVectorMode |
getSelectionVectorMode() |
int |
hashCode() |
boolean |
isEquivalent(BatchSchema other)
Compare that two schemas are identical according to the rules defined
in
MaterializedField.isEquivalent(MaterializedField). |
Iterator<MaterializedField> |
iterator() |
BatchSchema |
merge(BatchSchema otherSchema)
Merge two schemas to produce a new, merged schema.
|
static SchemaBuilder |
newBuilder() |
String |
toString() |
finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic BatchSchema(BatchSchema.SelectionVectorMode selectionVector, List<MaterializedField> fields)
public static SchemaBuilder newBuilder()
public int getFieldCount()
public MaterializedField getColumn(int index)
public Iterator<MaterializedField> iterator()
iterator in interface Iterable<MaterializedField>public BatchSchema.SelectionVectorMode getSelectionVectorMode()
public BatchSchema clone()
public boolean equals(Object obj)
isEquivalent(BatchSchema) method instead since
MaterializedField.isEquivalent(MaterializedField) method is updated to remove the reference check.public boolean isEquivalent(BatchSchema other)
MaterializedField.isEquivalent(MaterializedField). In particular,
this method requires that the fields have a 1:1 ordered correspondence
in the two schemas.other - another non-null batch schemaMaterializedField.isEquivalent(MaterializedField) rules,
false otherwisepublic BatchSchema merge(BatchSchema otherSchema)
Merging data with selection vectors is unlikely to be useful, or work well. With a selection vector, the two record batches would have to be correlated both in their selection vectors AND in the underlying vectors. Such a use case is hard to imagine. So, for now, this method forbids merging schemas if either of them carry a selection vector. If we discover a meaningful use case, we can revisit the issue.
otherSchema - the schema to merge with this onepublic String format()
Copyright © 2021 The Apache Software Foundation. All rights reserved.