public final class PrimitiveType extends Type
| Modifier and Type | Class and Description |
|---|---|
static class |
PrimitiveType.PrimitiveTypeName
Supported Primitive types
|
static interface |
PrimitiveType.PrimitiveTypeNameConverter<T,E extends Exception> |
Type.ID, Type.Repetition| Constructor and Description |
|---|
PrimitiveType(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.
will be removed in 2.0.0; use builders in
Types instead |
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 in
Types instead |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(TypeVisitor visitor)
Visits this type with the given visitor
|
ColumnOrder |
columnOrder() |
<T> PrimitiveComparator<T> |
comparator()
Returns the
Type specific comparator for properly comparing values. |
protected boolean |
containsPath(String[] path,
int depth) |
<T> T |
convert(List<GroupType> path,
TypeConverter<T> converter) |
protected boolean |
equals(Type other) |
DecimalMetadata |
getDecimalMetadata()
Deprecated.
|
int |
getMaxDefinitionLevel(String[] path,
int i) |
int |
getMaxRepetitionLevel(String[] path,
int i) |
protected List<String[]> |
getPaths(int depth) |
PrimitiveType.PrimitiveTypeName |
getPrimitiveTypeName() |
Type |
getType(String[] path,
int i) |
int |
getTypeLength() |
int |
hashCode() |
boolean |
isPrimitive() |
PrimitiveStringifier |
stringifier() |
protected boolean |
typeEquals(Type other)
Deprecated.
|
protected int |
typeHashCode()
Deprecated.
|
protected Type |
union(Type toMerge) |
protected Type |
union(Type toMerge,
boolean strict) |
PrimitiveType |
withId(int id) |
PrimitiveType |
withLogicalTypeAnnotation(LogicalTypeAnnotation logicalType) |
void |
writeToStringBuilder(StringBuilder sb,
String indent)
Writes a string representation to the provided StringBuilder
|
asGroupType, asPrimitiveType, eqOrBothNull, equals, getId, getLogicalTypeAnnotation, getName, getOriginalType, getRepetition, isRepetition, toStringpublic PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name)
repetition - OPTIONAL, REPEATED, REQUIREDprimitive - STRING, INT64, ...name - the name of the typepublic PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name)
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@Deprecated public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, String name, OriginalType originalType)
Types insteadrepetition - OPTIONAL, REPEATED, REQUIREDprimitive - STRING, INT64, ...name - the name of the typeoriginalType - (optional) the original type to help with cross schema convertion (LIST, MAP, ...)@Deprecated public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType)
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, ...)@Deprecated public PrimitiveType(Type.Repetition repetition, PrimitiveType.PrimitiveTypeName primitive, int length, String name, OriginalType originalType, DecimalMetadata decimalMeta, Type.ID id)
Types insteadrepetition - 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 fieldpublic PrimitiveType withId(int id)
public PrimitiveType withLogicalTypeAnnotation(LogicalTypeAnnotation logicalType)
logicalType - LogicalTypeAnnotationpublic PrimitiveType.PrimitiveTypeName getPrimitiveTypeName()
public int getTypeLength()
@Deprecated public DecimalMetadata getDecimalMetadata()
public boolean isPrimitive()
isPrimitive in class Typepublic void accept(TypeVisitor visitor)
public void writeToStringBuilder(StringBuilder sb, String indent)
writeToStringBuilder in class Typesb - the StringBuilder to write itself toindent - indentation level@Deprecated protected int typeHashCode()
typeHashCode in class Type@Deprecated protected boolean typeEquals(Type other)
typeEquals in class Typepublic int getMaxRepetitionLevel(String[] path, int i)
getMaxRepetitionLevel in class Typepublic int getMaxDefinitionLevel(String[] path, int i)
getMaxDefinitionLevel in class Typepublic <T> T convert(List<GroupType> path, TypeConverter<T> converter)
T - the type returned by the converterpath - a list of groups to convertconverter - logic to convert the treeprotected boolean containsPath(String[] path, int depth)
containsPath in class Typepublic <T> PrimitiveComparator<T> comparator()
Type specific comparator for properly comparing values. The natural ordering of the values
might not proper in certain cases (e.g. UINT_32 requires unsigned comparison of int values while
the natural ordering is signed.)T - the type of values compared by the returned PrimitiveComparatorpublic ColumnOrder columnOrder()
public PrimitiveStringifier stringifier()
Type specific stringifier for generating the proper string representation of the values.Copyright © 2024 The Apache Software Foundation. All rights reserved.