Package org.apache.avro
Class LogicalTypes
java.lang.Object
org.apache.avro.LogicalTypes
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Date represents a date without a timestatic class
Decimal represents arbitrary-precision fixed-scale decimal numbersstatic class
Duration represents a duration, consisting on months, days and millisecondsstatic class
static class
static class
static interface
Factory interface and SPI for logical types.static class
TimeMicros represents a time in microseconds without a datestatic class
TimeMillis represents a time in milliseconds without a datestatic class
TimestampMicros represents a date and time in microsecondsstatic class
TimestampMillis represents a date and time in millisecondsstatic class
TimestampNanos represents a date and time in nanosecondsstatic class
Uuid represents a uuid without a time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LogicalTypes.BigDecimal
Create a Big Decimal LogicalType that can accept any precision and scalestatic LogicalTypes.Date
date()
static LogicalTypes.Decimal
decimal
(int precision) Create a Decimal LogicalType with the given precision and scale 0static LogicalTypes.Decimal
decimal
(int precision, int scale) Create a Decimal LogicalType with the given precision and scalestatic LogicalType
duration()
static LogicalType
fromSchema
(Schema schema) Returns theLogicalType
from the schema, if one is present.static LogicalType
fromSchemaIgnoreInvalid
(Schema schema) static Map
<String, LogicalTypes.LogicalTypeFactory> Return an unmodifiable map of any registered customLogicalType
static void
register
(String logicalTypeName, LogicalTypes.LogicalTypeFactory factory) Register a logical type.static void
register
(LogicalTypes.LogicalTypeFactory factory) Register a logical type.static LogicalTypes.TimeMicros
static LogicalTypes.TimeMillis
static LogicalTypes.TimestampMicros
static LogicalTypes.TimestampMillis
static LogicalTypes.TimestampNanos
static LogicalType
uuid()
-
Constructor Details
-
LogicalTypes
public LogicalTypes()
-
-
Method Details
-
register
Register a logical type.- Parameters:
factory
- The logical type factory- Throws:
NullPointerException
- iffactory
orfactory.getTypedName()
isnull
-
register
Register a logical type.- Parameters:
logicalTypeName
- The logical type namefactory
- The logical type factory- Throws:
NullPointerException
- iflogicalTypeName
orfactory
isnull
-
getCustomRegisteredTypes
Return an unmodifiable map of any registered customLogicalType
-
fromSchema
Returns theLogicalType
from the schema, if one is present. -
fromSchemaIgnoreInvalid
-
decimal
Create a Decimal LogicalType with the given precision and scale 0 -
decimal
Create a Decimal LogicalType with the given precision and scale -
bigDecimal
Create a Big Decimal LogicalType that can accept any precision and scale -
uuid
-
duration
-
date
-
timeMillis
-
timeMicros
-
timestampMillis
-
timestampMicros
-
timestampNanos
-
localTimestampMillis
-
localTimestampMicros
-
localTimestampNanos
-