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) |
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.LogicalTypegetIdentifier in interface Schema.LogicalType<java.time.LocalDateTime,Row>public Schema.FieldType getArgumentType()
Schema.LogicalTypegetArgumentType in interface Schema.LogicalType<java.time.LocalDateTime,Row>public java.lang.String getArgument()
Schema.LogicalTypegetArgument in interface Schema.LogicalType<java.time.LocalDateTime,Row>public Schema.FieldType getBaseType()
Schema.LogicalTypeSchema.FieldType used to store values of this type.getBaseType in interface Schema.LogicalType<java.time.LocalDateTime,Row>public Row toBaseType(java.time.LocalDateTime input)
toBaseType in interface Schema.LogicalType<java.time.LocalDateTime,Row>public java.time.LocalDateTime toInputType(Row base)
Schema.LogicalTypeSchema.FieldType to the input type.toInputType in interface Schema.LogicalType<java.time.LocalDateTime,Row>