public class MetadataUtils extends Object
Constructor and Description |
---|
MetadataUtils() |
public static TupleSchema fromFields(Iterable<MaterializedField> fields)
public static ColumnMetadata fromField(MaterializedField field)
MaterializedField
. The type of the object will be either a
primitive, map or dict column, depending on the field's type. The logic
here mimics the code as written, which is very messy in some places.field
- the materialized field to wrappublic static ColumnMetadata fromView(MaterializedField field)
public static TupleSchema fromColumns(List<ColumnMetadata> columns)
columns
- list of columns that make up the tuplepublic static MapColumnMetadata newMap(MaterializedField field, TupleSchema schema)
MaterializedField
that describes the column, and a list
of column metadata objects that describe the columns in the map.field
- the materialized field that describes the map columnschema
- metadata that describes the tuple of columns in
the mappublic static MapColumnMetadata newMap(MaterializedField field)
public static MapColumnMetadata newMap(String name, TupleMetadata schema)
public static MapColumnMetadata newMap(String name)
public static DictColumnMetadata newDict(MaterializedField field)
public static DictColumnMetadata newDict(MaterializedField field, TupleSchema schema)
public static DictColumnMetadata newDict(String name)
public static VariantColumnMetadata newVariant(MaterializedField field, VariantSchema schema)
public static VariantColumnMetadata newVariant(String name, TypeProtos.DataMode cardinality)
public static RepeatedListColumnMetadata newRepeatedList(String name, ColumnMetadata child)
public static ColumnMetadata newMapArray(String name, TupleMetadata schema)
public static MapColumnMetadata newMap(String name, TypeProtos.DataMode dataMode, TupleMetadata schema)
public static ColumnMetadata newMapArray(String name)
public static DictColumnMetadata newDictArray(String name)
public static PrimitiveColumnMetadata newScalar(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode)
public static PrimitiveColumnMetadata newScalar(String name, TypeProtos.MajorType type)
public static ColumnMetadata newDecimal(String name, TypeProtos.DataMode mode, int precision, int scale)
public static ColumnMetadata newDecimal(String name, TypeProtos.MinorType type, TypeProtos.DataMode mode, int precision, int scale)
public static boolean isScalar(ColumnMetadata col)
public static boolean isScalar(TypeProtos.MinorType type)
public static boolean isComplex(TypeProtos.MinorType type)
public static ColumnMetadata newDynamic(String name)
public static ColumnMetadata wildcard()
public static boolean isWildcard(ColumnMetadata col)
public static ColumnMetadata cloneMapWithSchema(ColumnMetadata source, TupleMetadata members)
public static ColumnMetadata diffMap(ColumnMetadata map, ColumnMetadata other)
public static TupleMetadata diffTuple(TupleMetadata base, TupleMetadata subtend)
public static boolean hasDynamicColumns(TupleMetadata schema)
public static boolean isRepeatedList(ColumnMetadata col)
Copyright © 1970 The Apache Software Foundation. All rights reserved.