Package org.apache.parquet.schema
Class GroupType
- java.lang.Object
-
- org.apache.parquet.schema.Type
-
- org.apache.parquet.schema.GroupType
-
- Direct Known Subclasses:
MessageType
public class GroupType extends Type
Represents a group type: a list of fields
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.parquet.schema.Type
Type.ID, Type.Repetition
-
-
Constructor Summary
Constructors Constructor Description GroupType(Type.Repetition repetition, String name, List<Type> fields)GroupType(Type.Repetition repetition, String name, OriginalType originalType, List<Type> fields)Deprecated.GroupType(Type.Repetition repetition, String name, OriginalType originalType, Type... fields)Deprecated.GroupType(Type.Repetition repetition, String name, Type... fields)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccept(TypeVisitor visitor)Visits this type with the given visitorbooleancontainsField(String name)protected booleancontainsPath(String[] path, int depth)protected <T> List<T>convertChildren(List<GroupType> path, TypeConverter<T> converter)protected booleanequals(Type otherType)intgetFieldCount()intgetFieldIndex(String name)StringgetFieldName(int index)returns the name of the corresponding fieldList<Type>getFields()protected intgetMaxDefinitionLevel(String[] path, int depth)protected intgetMaxRepetitionLevel(String[] path, int depth)protected List<String[]>getPaths(int depth)TypegetType(int index)TypegetType(String fieldName)protected TypegetType(String[] path, int depth)inthashCode()booleanisPrimitive()protected booleantypeEquals(Type other)Deprecated.protected inttypeHashCode()Deprecated.protected Typeunion(Type toMerge)protected Typeunion(Type toMerge, boolean strict)GroupTypewithId(int id)GroupTypewithNewFields(List<Type> newFields)GroupTypewithNewFields(Type... newFields)voidwriteToStringBuilder(StringBuilder sb, String indent)Writes a string representation to the provided StringBuilder-
Methods inherited from class org.apache.parquet.schema.Type
asGroupType, asPrimitiveType, eqOrBothNull, equals, getId, getLogicalTypeAnnotation, getName, getOriginalType, getRepetition, isRepetition, toString
-
-
-
-
Constructor Detail
-
GroupType
public GroupType(Type.Repetition repetition, String name, List<Type> fields)
- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDname- the name of the fieldfields- the contained fields
-
GroupType
public GroupType(Type.Repetition repetition, String name, Type... fields)
- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDname- the name of the fieldfields- the contained fields
-
GroupType
@Deprecated public GroupType(Type.Repetition repetition, String name, OriginalType originalType, Type... fields)
Deprecated.- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDname- the name of the fieldoriginalType- (optional) the original type to help with cross schema conversion (LIST, MAP, ...)fields- the contained fields
-
GroupType
@Deprecated public GroupType(Type.Repetition repetition, String name, OriginalType originalType, List<Type> fields)
Deprecated.- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDname- the name of the fieldoriginalType- (optional) the original type to help with cross schema conversion (LIST, MAP, ...)fields- the contained fields
-
-
Method Detail
-
withId
public GroupType withId(int id)
-
withNewFields
public GroupType withNewFields(List<Type> newFields)
- Parameters:
newFields- a list of types to use as fields in a copy of this group- Returns:
- a group with the same attributes and new fields.
-
withNewFields
public GroupType withNewFields(Type... newFields)
- Parameters:
newFields- an array of types to use as fields in a copy of this group- Returns:
- a group with the same attributes and new fields.
-
getFieldName
public String getFieldName(int index)
returns the name of the corresponding field- Parameters:
index- the index of the desired field in this type- Returns:
- the name of the field at this index
-
containsField
public boolean containsField(String name)
- Parameters:
name- the requested name- Returns:
- whether this type contains a field with that name
-
getFieldIndex
public int getFieldIndex(String name)
- Parameters:
name- string name of a field- Returns:
- the index of the field with that name
-
getFieldCount
public int getFieldCount()
- Returns:
- the number of fields in this type
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitivein classType- Returns:
- false
-
getType
public Type getType(String fieldName)
- Parameters:
fieldName- string name of a field- Returns:
- the type of this field by name
-
getType
public Type getType(int index)
- Parameters:
index- integer index of a field- Returns:
- the type of this field by index
-
writeToStringBuilder
public void writeToStringBuilder(StringBuilder sb, String indent)
Writes a string representation to the provided StringBuilder- Specified by:
writeToStringBuilderin classType- Parameters:
sb- the StringBuilder to write itself toindent- indentation level
-
accept
public void accept(TypeVisitor visitor)
Visits this type with the given visitor
-
typeHashCode
@Deprecated protected int typeHashCode()
Deprecated.- Specified by:
typeHashCodein classType
-
typeEquals
@Deprecated protected boolean typeEquals(Type other)
Deprecated.- Specified by:
typeEqualsin classType
-
getMaxRepetitionLevel
protected int getMaxRepetitionLevel(String[] path, int depth)
- Specified by:
getMaxRepetitionLevelin classType
-
getMaxDefinitionLevel
protected int getMaxDefinitionLevel(String[] path, int depth)
- Specified by:
getMaxDefinitionLevelin classType
-
containsPath
protected boolean containsPath(String[] path, int depth)
- Specified by:
containsPathin classType
-
convertChildren
protected <T> List<T> convertChildren(List<GroupType> path, TypeConverter<T> converter)
-
-