public class PrimitiveColumnMetadata extends AbstractColumnMetadata
Metadata is of two types:
ColumnMetadata.StructureType
mode, name, precision, scale, type
BLANK_AS_NULL, BLANK_AS_PROP, BLANK_AS_ZERO, DEFAULT_ARRAY_SIZE, DEFAULT_VALUE_PROP, EXCLUDE_FROM_WILDCARD, EXPECTED_CARDINALITY_PROP, EXPECTED_WIDTH_PROP, FORMAT_PROP, IMPLICIT_COL_TYPE, IMPLICIT_FILENAME, IMPLICIT_FILEPATH, IMPLICIT_FQN, IMPLICIT_PARTITION_PREFIX, IMPLICIT_SUFFIX
DRILL_PROP_PREFIX
Constructor and Description |
---|
PrimitiveColumnMetadata(MaterializedField schema) |
PrimitiveColumnMetadata(PrimitiveColumnMetadata from) |
PrimitiveColumnMetadata(String name,
TypeProtos.MajorType type) |
PrimitiveColumnMetadata(String name,
TypeProtos.MinorType type,
TypeProtos.DataMode mode) |
Modifier and Type | Method and Description |
---|---|
ColumnMetadata |
cloneEmpty()
Create an empty version of this column.
|
ColumnMetadata |
copy() |
DateTimeFormatter |
dateTimeFormatter()
Returns the formatter to use for date/time values.
|
MaterializedField |
emptySchema() |
int |
expectedWidth()
Get the expected width for a column.
|
boolean |
isEquivalent(ColumnMetadata o)
Report whether one column is equivalent to another.
|
TypeProtos.MajorType |
majorType() |
ColumnMetadata |
mergeWith(MaterializedField field) |
int |
precision()
Returns precision for current column.
|
int |
scale()
Returns scale for current column.
|
MaterializedField |
schema() |
void |
setExpectedWidth(int width)
For variable-width columns, specify the expected column width to be used
when allocating a new vector.
|
ColumnMetadata.StructureType |
structureType() |
String |
typeString()
Converts type metadata into string representation
accepted by the table schema parser.
|
Object |
valueFromString(String value)
Converts value in string literal form into Object instance based on
TypeProtos.MinorType value. |
String |
valueToString(Object value)
Converts given value instance into String literal representation based on
column metadata type.
|
appendContents, bind, childSchema, columnString, createColumnMetadata, decodeDefaultValue, defaultValue, dimensions, equals, equalsWithProperties, equalsWithProperties, escapeSpecialSymbols, expectedElementCount, format, isArray, isDict, isDynamic, isMap, isMultiList, isNullable, isVariableWidth, isVariant, mode, name, properties, setDefaultValue, setExpectedElementCount, setFormat, toString, tupleSchema, type, variantSchema
booleanProperty, booleanProperty, hashCode, hasProperties, intProperty, intProperty, property, property, removeProperty, setBooleanProperty, setIntProperty, setProperties, setProperty
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
booleanProperty, booleanProperty, hasProperties, intProperty, intProperty, pluginPrefix, property, property, removeProperty, setBooleanProperty, setIntProperty, setProperties, setProperty
public PrimitiveColumnMetadata(MaterializedField schema)
public PrimitiveColumnMetadata(String name, TypeProtos.MajorType type)
public PrimitiveColumnMetadata(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode)
public PrimitiveColumnMetadata(PrimitiveColumnMetadata from)
public ColumnMetadata copy()
public ColumnMetadata.StructureType structureType()
public int expectedWidth()
ColumnMetadata
expectedWidth
in interface ColumnMetadata
expectedWidth
in class AbstractColumnMetadata
public int precision()
AbstractColumnMetadata
precision
in interface ColumnMetadata
precision
in class AbstractColumnMetadata
public int scale()
AbstractColumnMetadata
scale
in interface ColumnMetadata
scale
in class AbstractColumnMetadata
public void setExpectedWidth(int width)
ColumnMetadata
setExpectedWidth
in interface ColumnMetadata
setExpectedWidth
in class AbstractColumnMetadata
width
- the expected column widthpublic DateTimeFormatter dateTimeFormatter()
ColumnMetadata
dateTimeFormatter
in interface ColumnMetadata
dateTimeFormatter
in class AbstractColumnMetadata
public ColumnMetadata cloneEmpty()
ColumnMetadata
public ColumnMetadata mergeWith(MaterializedField field)
public TypeProtos.MajorType majorType()
majorType
in interface ColumnMetadata
majorType
in class AbstractColumnMetadata
public MaterializedField schema()
public MaterializedField emptySchema()
public String typeString()
ColumnMetadata
typeString
in interface ColumnMetadata
typeString
in class AbstractColumnMetadata
public Object valueFromString(String value)
TypeProtos.MinorType
value.
Returns null in case of error during parsing or unsupported type.valueFromString
in interface ColumnMetadata
valueFromString
in class AbstractColumnMetadata
value
- value in string literal formpublic String valueToString(Object value)
valueToString
in interface ColumnMetadata
valueToString
in class AbstractColumnMetadata
value
- value instancepublic boolean isEquivalent(ColumnMetadata o)
ColumnMetadata
isEquivalent
in interface ColumnMetadata
isEquivalent
in class AbstractColumnMetadata
Copyright © 1970 The Apache Software Foundation. All rights reserved.