public interface ColumnMetadata extends Propertied
Modifier and Type | Interface and Description |
---|---|
static class |
ColumnMetadata.StructureType
Rough characterization of Drill types into metadata categories.
|
Modifier and Type | Field and Description |
---|---|
static String |
BLANK_AS_NULL
Convert blanks to null values (if the column is nullable), or
fill with the default value (non-nullable.)
|
static String |
BLANK_AS_PROP
Indicates how to handle blanks.
|
static String |
BLANK_AS_ZERO
Convert blanks for numeric fields to 0.
|
static int |
DEFAULT_ARRAY_SIZE |
static String |
DEFAULT_VALUE_PROP
Default value represented as a string.
|
static String |
EXCLUDE_FROM_WILDCARD
Indicates whether to project the column in a wildcard (*) query.
|
static String |
EXPECTED_CARDINALITY_PROP
Predicted number of elements per array entry.
|
static String |
EXPECTED_WIDTH_PROP
Expected (average) width for variable-width columns.
|
static String |
FORMAT_PROP
Optional format to use when converting to/from string values.
|
static String |
IMPLICIT_COL_TYPE
Indicates that a provided schema column is an implicit column
(one defined by Drill rather than the reader.) Allows the implicit
schema to reify partition names, say, as reader-specific names.
|
static String |
IMPLICIT_FILENAME
File name implicit column type.
|
static String |
IMPLICIT_FILEPATH
File path implicit column type.
|
static String |
IMPLICIT_FQN
Fully-qualified name implicit column type.
|
static String |
IMPLICIT_PARTITION_PREFIX
Prefix for partition directories.
|
static String |
IMPLICIT_SUFFIX
File suffix implicit column type.
|
DRILL_PROP_PREFIX
Modifier and Type | Method and Description |
---|---|
void |
bind(TupleMetadata parentTuple) |
ColumnMetadata |
childSchema()
Schema of inner dimension for MULTI_ARRAY columns.
|
ColumnMetadata |
cloneEmpty()
Create an empty version of this column.
|
String |
columnString()
Converts column metadata into string representation
accepted by the table schema parser.
|
ColumnMetadata |
copy() |
DateTimeFormatter |
dateTimeFormatter()
Returns the formatter to use for date/time values.
|
Object |
decodeDefaultValue()
Returns the default value decoded into object form.
|
String |
defaultValue()
Returns the default value for this column in String literal representation.
|
int |
dimensions() |
MaterializedField |
emptySchema() |
int |
expectedElementCount()
Returns the expected array cardinality for array columns, or 1 for
non-array columns.
|
int |
expectedWidth()
Get the expected width for a column.
|
String |
format() |
boolean |
isArray() |
boolean |
isDict() |
boolean |
isDynamic()
Reports if the column is dynamic.
|
boolean |
isEquivalent(ColumnMetadata other)
Report whether one column is equivalent to another.
|
boolean |
isMap() |
boolean |
isMultiList()
Determine if the schema represents a column with a LIST type with
UNION elements.
|
boolean |
isNullable() |
boolean |
isVariableWidth() |
boolean |
isVariant() |
TypeProtos.MajorType |
majorType() |
TypeProtos.DataMode |
mode() |
String |
name() |
int |
precision() |
int |
scale() |
MaterializedField |
schema() |
void |
setDefaultValue(String value)
Sets the default value property using the string-encoded form of the value.
|
void |
setExpectedElementCount(int childCount)
For an array column, specify the expected average array cardinality.
|
void |
setExpectedWidth(int width)
For variable-width columns, specify the expected column width to be used
when allocating a new vector.
|
void |
setFormat(String value) |
ColumnMetadata.StructureType |
structureType() |
TupleMetadata |
tupleSchema()
Schema for TUPLE columns.
|
TypeProtos.MinorType |
type() |
String |
typeString()
Converts type metadata into string representation
accepted by the table schema parser.
|
Object |
valueFromString(String value) |
String |
valueToString(Object value) |
VariantMetadata |
variantSchema()
Schema for VARIANT columns.
|
booleanProperty, booleanProperty, hasProperties, intProperty, intProperty, pluginPrefix, properties, property, property, removeProperty, setBooleanProperty, setIntProperty, setProperties, setProperty
static final String EXPECTED_CARDINALITY_PROP
static final String DEFAULT_VALUE_PROP
static final String EXPECTED_WIDTH_PROP
static final String FORMAT_PROP
static final String BLANK_AS_PROP
static final String BLANK_AS_NULL
static final String BLANK_AS_ZERO
static final String EXCLUDE_FROM_WILDCARD
Marking a column (either in the provided schema or the reader schema) will prevent that column from appearing in a wildcard expansion.
static final int DEFAULT_ARRAY_SIZE
static final String IMPLICIT_COL_TYPE
dir0
might be reified as year
, etc.
Available when the underlying reader supports implicit columns. The value is the defined implicit column name (not the name set via system/session options.) Using the defined name makes the provided schema immune from runtime changes to column names.
As the result of adding this feature, any column not tagged as implicit is a reader column, even if that column happens to have the same (currently selected runtime) name as an implicit column.
static final String IMPLICIT_FQN
static final String IMPLICIT_FILEPATH
static final String IMPLICIT_FILENAME
static final String IMPLICIT_SUFFIX
static final String IMPLICIT_PARTITION_PREFIX
NULL
value.ColumnMetadata.StructureType structureType()
TupleMetadata tupleSchema()
VariantMetadata variantSchema()
ColumnMetadata childSchema()
Sorry for the mess, but it is how the code works and we are not in a position to revisit data type fundamentals.
MaterializedField schema()
MaterializedField emptySchema()
String name()
TypeProtos.MinorType type()
TypeProtos.MajorType majorType()
TypeProtos.DataMode mode()
int dimensions()
boolean isNullable()
boolean isArray()
boolean isVariableWidth()
boolean isMap()
boolean isVariant()
boolean isDict()
boolean isDynamic()
true
if the column does not yet have a concrete
type, false
if the column type is concreteboolean isMultiList()
boolean isEquivalent(ColumnMetadata other)
void setExpectedWidth(int width)
width
- the expected column widthint expectedWidth()
void setExpectedElementCount(int childCount)
childCount
- the expected average array cardinality. Defaults to
1 for non-array columns, 10 for array columnsint expectedElementCount()
void setFormat(String value)
String format()
DateTimeFormatter dateTimeFormatter()
void setDefaultValue(String value)
value
- the default value in String representationString defaultValue()
Object decodeDefaultValue()
decodeValue(defaultValue());
ColumnWriter#setObject()
method.ColumnMetadata cloneEmpty()
int precision()
int scale()
void bind(TupleMetadata parentTuple)
ColumnMetadata copy()
String typeString()
String columnString()
Copyright © 1970 The Apache Software Foundation. All rights reserved.