Interface LogicalType
- All Known Implementing Classes:
LogicalType.BsonType, LogicalType.DateType, LogicalType.DecimalType, LogicalType.EnumType, LogicalType.Float16Type, LogicalType.GeographyType, LogicalType.GeometryType, LogicalType.IntervalType, LogicalType.IntType, LogicalType.JsonType, LogicalType.ListType, LogicalType.MapType, LogicalType.NullType, LogicalType.StringType, LogicalType.TimestampType, LogicalType.TimeType, LogicalType.UuidType, LogicalType.VariantType
public sealed interface LogicalType
permits LogicalType.StringType, LogicalType.EnumType, LogicalType.UuidType, LogicalType.IntType, LogicalType.DecimalType, LogicalType.DateType, LogicalType.TimeType, LogicalType.TimestampType, LogicalType.IntervalType, LogicalType.JsonType, LogicalType.BsonType, LogicalType.ListType, LogicalType.MapType, LogicalType.VariantType, LogicalType.GeometryType, LogicalType.GeographyType, LogicalType.Float16Type, LogicalType.NullType
Logical types that provide semantic meaning to physical types. Sealed interface allows for parameterized types (e.g., DECIMAL with scale/precision).
Construct a member through the static factory of the same name — string(),
decimal(int, int), and so on. The parameterless factories return a shared instance, so
calling one twice yields the same object.
Each implementation's toString() renders the Parquet-style annotation token shown in
schema dumps and metadata views — STRING, LIST, DECIMAL(10, 2), TIMESTAMP(MICROS, UTC),
and so on — not the default record representation.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordBSON document stored as a byte array.static final recordCalendar date (days since Unix epoch).static final recordDecimal with fixed precision and scale.static enumGeodesic formulations to model and compute the shortest path on Earth.static final recordEnum stored as a UTF-8 string.static final recordIEEE 754 half-precision (binary16) floating point, stored as a 2-byteFIXED_LEN_BYTE_ARRAYin little-endian byte order.static final recordGeography type with configurable CRSstatic final recordGeometry type with configurable CRSstatic final recordInterval stored as a 12-byte fixed-length byte array (months, days, millis).static final recordInteger type with a specific bit width and signedness.static final recordJSON document stored as a UTF-8 string.static final recordList (repeated element) logical type.static final recordMap (key-value pairs) logical type.static final recordColumn whose every value is null.static final recordUTF-8 encoded string.static final recordTimestamp with configurable precision and UTC adjustment.static final recordTime of day with configurable precision and UTC adjustment.static enumResolution of time and timestamp logical types.static final recordUUID stored as a 16-byte fixed-length byte array.static final recordVariant (self-describing, semi-structured) logical type per the Parquet Variant spec. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic LogicalType.BsonTypebson()TheBSONannotation, for a BSON document stored as a byte array.static LogicalType.DateTypedate()TheDATEannotation, for a calendar date in days since the Unix epoch.static LogicalType.DecimalTypedecimal(int precision, int scale) TheDECIMALannotation, for a decimal of a given precision and scale.static LogicalType.EnumTypeenumType()TheENUMannotation, for an enum stored as a UTF-8 string.static LogicalType.Float16Typefloat16()TheFLOAT16annotation, for an IEEE 754 half-precision float stored as a 2-byte fixed-length byte array.static LogicalType.GeographyTypegeography(String crs, LogicalType.EdgeInterpolationAlgorithm edgeInterpolation) TheGEOGRAPHYannotation, for geodesic geospatial values in a given CRS.static LogicalType.GeometryTypeTheGEOMETRYannotation, for planar geospatial values in a given CRS.static LogicalType.IntervalTypeinterval()TheINTERVALannotation, for an interval stored as a 12-byte fixed-length byte array.static LogicalType.IntTypeintType(int bitWidth, boolean isSigned) TheINTannotation, for an integer of a given bit width and signedness.static LogicalType.JsonTypejson()TheJSONannotation, for a JSON document stored as a UTF-8 string.static LogicalType.ListTypelist()TheLISTannotation, for a group holding a repeated element.static LogicalType.MapTypemap()TheMAPannotation, for a group holding key-value pairs.static LogicalType.NullTypenullType()TheNULLannotation, for a column whose every value is null.static LogicalType.StringTypestring()TheSTRINGannotation, for a UTF-8 encoded string.static LogicalType.TimeTypetime(boolean isAdjustedToUTC, LogicalType.TimeUnit unit) TheTIMEannotation, for a time of day of a given resolution.static LogicalType.TimestampTypetimestamp(boolean isAdjustedToUTC, LogicalType.TimeUnit unit) TheTIMESTAMPannotation, for a timestamp of a given resolution.static LogicalType.UuidTypeuuid()TheUUIDannotation, for a UUID stored as a 16-byte fixed-length byte array.static LogicalType.VariantTypevariant(int specVersion) TheVARIANTannotation, for a group holding a self-describing, semi-structured value.
-
Method Details
-
string
TheSTRINGannotation, for a UTF-8 encoded string. -
nullType
TheNULLannotation, for a column whose every value is null. -
enumType
TheENUMannotation, for an enum stored as a UTF-8 string. -
uuid
TheUUIDannotation, for a UUID stored as a 16-byte fixed-length byte array. -
date
TheDATEannotation, for a calendar date in days since the Unix epoch. -
json
TheJSONannotation, for a JSON document stored as a UTF-8 string. -
bson
TheBSONannotation, for a BSON document stored as a byte array. -
interval
TheINTERVALannotation, for an interval stored as a 12-byte fixed-length byte array. -
float16
TheFLOAT16annotation, for an IEEE 754 half-precision float stored as a 2-byte fixed-length byte array. -
intType
TheINTannotation, for an integer of a given bit width and signedness.- Parameters:
bitWidth- number of bits (8, 16, 32, or 64)isSigned-truefor signed integers,falsefor unsigned
-
decimal
TheDECIMALannotation, for a decimal of a given precision and scale.- Parameters:
precision- total number of digits (must be positive)scale- number of digits after the decimal point
-
time
TheTIMEannotation, for a time of day of a given resolution.- Parameters:
isAdjustedToUTC-trueif the value is normalized to UTCunit- time resolution (millis, micros, or nanos)
-
timestamp
TheTIMESTAMPannotation, for a timestamp of a given resolution.- Parameters:
isAdjustedToUTC-trueif the value is normalized to UTCunit- time resolution (millis, micros, or nanos)
-
list
TheLISTannotation, for a group holding a repeated element. -
map
TheMAPannotation, for a group holding key-value pairs. -
variant
TheVARIANTannotation, for a group holding a self-describing, semi-structured value.- Parameters:
specVersion- spec version declared by the writer (currently always1)
-
geometry
TheGEOMETRYannotation, for planar geospatial values in a given CRS.- Parameters:
crs- geospatial coordinate reference system,OGC:CRS84whennull
-
geography
static LogicalType.GeographyType geography(String crs, LogicalType.EdgeInterpolationAlgorithm edgeInterpolation) TheGEOGRAPHYannotation, for geodesic geospatial values in a given CRS.- Parameters:
crs- geospatial coordinate reference system,OGC:CRS84whennulledgeInterpolation- geodesic formulation,LogicalType.EdgeInterpolationAlgorithm.SPHERICALwhennull
-