public class DateTime extends java.lang.Object implements Schema.LogicalType<java.time.LocalDateTime,Row>
It cannot represent an instant on the time-line without additional information such as an offset or time-zone.
Its input type is a LocalDateTime
, and base type is a Row
containing Date
field and Time field. Date field is the same as the base type of Date
, which is a Long
that represents incrementing count of days where day 0 is 1970-01-01 (ISO). Time field is the
same as the base type of Time
, which is a Long that represents a count of time in
nanoseconds.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_FIELD_NAME |
static Schema |
DATETIME_SCHEMA |
static java.lang.String |
TIME_FIELD_NAME |
Constructor and Description |
---|
DateTime() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getArgument()
An optional argument to configure the type.
|
Schema.FieldType |
getArgumentType()
A schema type representing how to interpret the argument.
|
Schema.FieldType |
getBaseType()
The base
Schema.FieldType used to store values of this type. |
java.lang.String |
getIdentifier()
The unique identifier for this type.
|
Row |
toBaseType(java.time.LocalDateTime input)
Convert the input type to the type Java type used by the base
Schema.FieldType . |
java.time.LocalDateTime |
toInputType(Row base)
Convert the Java type used by the base
Schema.FieldType to the input type. |
public static final java.lang.String DATE_FIELD_NAME
public static final java.lang.String TIME_FIELD_NAME
public static final Schema DATETIME_SCHEMA
public java.lang.String getIdentifier()
Schema.LogicalType
getIdentifier
in interface Schema.LogicalType<java.time.LocalDateTime,Row>
public Schema.FieldType getArgumentType()
Schema.LogicalType
null
indicates this logical
type is not parameterized by an argument.getArgumentType
in interface Schema.LogicalType<java.time.LocalDateTime,Row>
public java.lang.String getArgument()
Schema.LogicalType
getArgument
in interface Schema.LogicalType<java.time.LocalDateTime,Row>
public Schema.FieldType getBaseType()
Schema.LogicalType
Schema.FieldType
used to store values of this type.getBaseType
in interface Schema.LogicalType<java.time.LocalDateTime,Row>
public Row toBaseType(java.time.LocalDateTime input)
Schema.LogicalType
Schema.FieldType
.toBaseType
in interface Schema.LogicalType<java.time.LocalDateTime,Row>
public java.time.LocalDateTime toInputType(Row base)
Schema.LogicalType
Schema.FieldType
to the input type.toInputType
in interface Schema.LogicalType<java.time.LocalDateTime,Row>