Package org.apache.parquet.schema
Class PrimitiveType
java.lang.Object
org.apache.parquet.schema.Type
org.apache.parquet.schema.PrimitiveType
Representation of a Primitive type
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumSupported Primitive typesstatic interfaceNested classes/interfaces inherited from class org.apache.parquet.schema.Type
Type.ID, Type.Repetition -
Constructor Summary
ConstructorsConstructorDescriptionPrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name) PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType) Deprecated.PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType, DecimalMetadata decimalMeta, Type.ID id) Deprecated.PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name) PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name, OriginalType originalType) Deprecated.will be removed in 2.0.0; use builders inTypesinstead -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(TypeVisitor visitor) Visits this type with the given visitor<T> PrimitiveComparator<T>Returns theTypespecific comparator for properly comparing values.protected booleancontainsPath(String[] path, int depth) <T> Tconvert(List<GroupType> path, TypeConverter<T> converter) protected booleanDeprecated.intgetMaxDefinitionLevel(String[] path, int i) intgetMaxRepetitionLevel(String[] path, int i) getPaths(int depth) intinthashCode()booleanprotected booleantypeEquals(Type other) Deprecated.protected intDeprecated.protected Typeprotected TypewithColumnOrder(ColumnOrder columnOrder) withId(int id) withLogicalTypeAnnotation(LogicalTypeAnnotation logicalType) voidwriteToStringBuilder(StringBuilder sb, String indent) Writes a string representation to the provided StringBuilderMethods inherited from class org.apache.parquet.schema.Type
asGroupType, asPrimitiveType, eqOrBothNull, equals, getId, getLogicalTypeAnnotation, getName, getOriginalType, getRepetition, isRepetition, toString
-
Constructor Details
-
PrimitiveType
public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name) - Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDprimitive- STRING, INT64, ...name- the name of the type
-
PrimitiveType
public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name) - Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDprimitive- STRING, INT64, ...length- the length if the type is FIXED_LEN_BYTE_ARRAY, 0 otherwise (XXX)name- the name of the type
-
PrimitiveType
@Deprecated public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name, OriginalType originalType) Deprecated.will be removed in 2.0.0; use builders inTypesinstead- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDprimitive- STRING, INT64, ...name- the name of the typeoriginalType- (optional) the original type to help with cross schema convertion (LIST, MAP, ...)
-
PrimitiveType
@Deprecated public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType) Deprecated.- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDprimitive- STRING, INT64, ...name- the name of the typelength- the length if the type is FIXED_LEN_BYTE_ARRAY, 0 otherwise (XXX)originalType- (optional) the original type to help with cross schema conversion (LIST, MAP, ...)
-
PrimitiveType
@Deprecated public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType, DecimalMetadata decimalMeta, Type.ID id) Deprecated.will be removed in 2.0.0; use builders inTypesinstead- Parameters:
repetition- OPTIONAL, REPEATED, REQUIREDprimitive- STRING, INT64, ...name- the name of the typelength- the length if the type is FIXED_LEN_BYTE_ARRAY, 0 otherwiseoriginalType- (optional) the original type (MAP, DECIMAL, UTF8, ...)decimalMeta- (optional) metadata about the decimal typeid- the id of the field
-
-
Method Details
-
withId
-
withLogicalTypeAnnotation
- Parameters:
logicalType- LogicalTypeAnnotation- Returns:
- a new PrimitiveType with the same fields and the given logical type annotation
-
withColumnOrder
- Parameters:
columnOrder- the column order- Returns:
- the same type with the column order set
-
getPrimitiveTypeName
- Returns:
- the primitive type
-
getTypeLength
public int getTypeLength()- Returns:
- the type length
-
getDecimalMetadata
Deprecated.- Returns:
- the decimal type metadata
-
isPrimitive
public boolean isPrimitive()- Specified by:
isPrimitivein classType- Returns:
- true
-
accept
Visits this type with the given visitor -
writeToStringBuilder
Writes a string representation to the provided StringBuilder- Specified by:
writeToStringBuilderin classType- Parameters:
sb- the StringBuilder to write itself toindent- indentation level
-
typeHashCode
Deprecated.- Specified by:
typeHashCodein classType
-
typeEquals
Deprecated.- Specified by:
typeEqualsin classType
-
equals
-
hashCode
public int hashCode() -
getMaxRepetitionLevel
- Specified by:
getMaxRepetitionLevelin classType
-
getMaxDefinitionLevel
- Specified by:
getMaxDefinitionLevelin classType
-
getType
-
getPaths
-
convert
-
containsPath
- Specified by:
containsPathin classType
-
union
-
union
-
comparator
Returns theTypespecific comparator for properly comparing values. The natural ordering of the values might not proper in certain cases (e.g.UINT_32requires unsigned comparison ofintvalues while the natural ordering is signed.)- Type Parameters:
T- the type of values compared by the returned PrimitiveComparator- Returns:
- a PrimitiveComparator for values of this type
-
columnOrder
- Returns:
- the column order for this type
-
stringifier
- Returns:
- the
Typespecific stringifier for generating the proper string representation of the values.
-
Typesinstead