public class InternalSchema extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
ARRAY_ELEMENT |
static String |
MAP_KEY |
static String |
MAP_VALUE |
| Constructor and Description |
|---|
InternalSchema(long versionId,
int maxColumnId,
Types.RecordType recordType) |
InternalSchema(long versionId,
Types.RecordType recordType) |
InternalSchema(Types.RecordType recordType) |
| Modifier and Type | Method and Description |
|---|---|
List<Types.Field> |
columns()
Returns a List of the
columns in this Schema. |
boolean |
equals(Object o) |
Types.Field |
findField(int id)
Returns the sub-field identified by the field id.
|
Types.Field |
findField(String name)
Returns a sub-field by name as a
Types.Field. |
String |
findFullName(int id)
Returns the fully qualified name of the field corresponding to the given id.
|
int |
findIdByName(String name) |
Type |
findType(int id)
Returns the
Type of a sub-field identified by the field id. |
Type |
findType(String name)
Returns the
Type of a sub-field identified by the field name. |
List<String> |
getAllColsFullName()
Get all columns full name.
|
Set<Integer> |
getAllIds()
Returns all field ids
|
static InternalSchema |
getEmptyInternalSchema() |
int |
getMaxColumnId()
Returns the max column id for this schema.
|
Map<String,Integer> |
getNameToPosition()
Returns the full name of the field and its position in the schema.
|
Types.RecordType |
getRecord() |
boolean |
hasColumn(String colName,
boolean caseSensitive)
Whether
colName exists in the current Schema |
int |
hashCode() |
boolean |
isEmptySchema() |
long |
schemaId()
Returns the version ID for this schema.
|
void |
setMaxColumnId(int maxColumnId)
Set the version ID for this schema.
|
InternalSchema |
setSchemaId(long versionId)
Set the version ID for this schema.
|
String |
toString() |
public static final String ARRAY_ELEMENT
public static final String MAP_KEY
public static final String MAP_VALUE
public InternalSchema(Types.RecordType recordType)
public InternalSchema(long versionId,
int maxColumnId,
Types.RecordType recordType)
public InternalSchema(long versionId,
Types.RecordType recordType)
public static InternalSchema getEmptyInternalSchema()
public boolean isEmptySchema()
public Types.RecordType getRecord()
public InternalSchema setSchemaId(long versionId)
public long schemaId()
public void setMaxColumnId(int maxColumnId)
public int getMaxColumnId()
public List<Types.Field> columns()
columns in this Schema.public String findFullName(int id)
id - a field idpublic Type findType(String name)
Type of a sub-field identified by the field name.name - a field namepublic Type findType(int id)
Type of a sub-field identified by the field id.id - a field idpublic Types.Field findField(int id)
id - a field idpublic Types.Field findField(String name)
Types.Field.
The result may be a top-level or a nested field.name - a String namepublic boolean hasColumn(String colName, boolean caseSensitive)
colName exists in the current SchemacolName - a column namecaseSensitive - whether columns names should be treated as case-sensitivecolNamepublic int findIdByName(String name)
public Map<String,Integer> getNameToPosition()
Copyright © 2024 The Apache Software Foundation. All rights reserved.