Package org.apache.parquet.schema
Class Type
java.lang.Object
org.apache.parquet.schema.Type
- Direct Known Subclasses:
GroupType,PrimitiveType
Represents the declared type for a field in a schema.
The Type object represents both the actual underlying type of the object
(eg a primitive or group) as well as its attributes such as whether it is
repeated, required, or optional.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classrepresents a field IDstatic enumConstraint on the repetition of a field -
Constructor Summary
ConstructorsConstructorDescriptionType(String name, Type.Repetition repetition) Deprecated.Type(String name, Type.Repetition repetition, OriginalType originalType) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionabstract voidaccept(TypeVisitor visitor) Visits this type with the given visitorprotected abstract booleancontainsPath(String[] path, int depth) protected booleaneqOrBothNull(Object o1, Object o2) booleanprotected booleangetId()protected abstract intgetMaxDefinitionLevel(String[] path, int i) protected abstract intgetMaxRepetitionLevel(String[] path, int i) getName()getPaths(int depth) protected abstract TypeinthashCode()abstract booleanbooleantoString()protected abstract booleantypeEquals(Type other) Deprecated.protected abstract intDeprecated.protected abstract Typeprotected abstract Typeabstract TypewithId(int id) abstract voidwriteToStringBuilder(StringBuilder sb, String indent) Writes a string representation to the provided StringBuilder
-
Constructor Details
-
Type
Deprecated.- Parameters:
name- the name of the typerepetition- OPTIONAL, REPEATED, REQUIRED
-
Type
Deprecated.- Parameters:
name- the name of the typerepetition- OPTIONAL, REPEATED, REQUIREDoriginalType- (optional) the original type to help with cross schema conversion (LIST, MAP, ...)
-
-
Method Details
-
withId
- Parameters:
id- an integer id- Returns:
- the same type with the id field set
-
getName
- Returns:
- the name of the type
-
isRepetition
- Parameters:
rep- repetition level to test- Returns:
- if repetition of the type is rep
-
getRepetition
- Returns:
- the repetition constraint
-
getId
- Returns:
- the id of the field (if defined)
-
getLogicalTypeAnnotation
-
getOriginalType
- Returns:
- the original type (LIST, MAP, ...)
-
isPrimitive
public abstract boolean isPrimitive()- Returns:
- if this is a primitive type
-
asGroupType
- Returns:
- this if it's a group type
- Throws:
ClassCastException- if not
-
asPrimitiveType
- Returns:
- this if it's a primitive type
- Throws:
ClassCastException- if not
-
writeToStringBuilder
Writes a string representation to the provided StringBuilder- Parameters:
sb- the StringBuilder to write itself toindent- indentation level
-
accept
Visits this type with the given visitor- Parameters:
visitor- the visitor to visit this type
-
typeHashCode
Deprecated. -
typeEquals
Deprecated. -
hashCode
public int hashCode() -
equals
-
equals
-
eqOrBothNull
-
getMaxRepetitionLevel
-
getMaxDefinitionLevel
-
getType
-
getPaths
-
containsPath
-
union
- Parameters:
toMerge- the type to merge into this one- Returns:
- the union result of merging toMerge into this
-
union
- Parameters:
toMerge- the type to merge into this onestrict- should schema primitive types match- Returns:
- the union result of merging toMerge into this
-
toString
-