public class LogicalType extends Object
Modifier and Type | Field and Description |
---|---|
static String |
LOGICAL_TYPE_PROP |
Constructor and Description |
---|
LogicalType(String logicalTypeName) |
public static final String LOGICAL_TYPE_PROP
public LogicalType(String logicalTypeName)
public String getName()
This name is set as the Schema property "logicalType".
public Schema addToSchema(Schema schema)
The "logicalType" property will be set to this type's name, and other type-specific properties may be added. The Schema is first validated to ensure it is compatible.
schema
- a SchemaIllegalArgumentException
- if the type and schema are incompatiblepublic void validate(Schema schema)
This will throw an exception if the Schema is incompatible with this type. For example, a date is stored as an int and is incompatible with a fixed Schema.
schema
- a SchemaIllegalArgumentException
- if the type and schema are incompatibleCopyright © 2009–2017 The Apache Software Foundation. All rights reserved.