Class DynamicColumn

All Implemented Interfaces:
ColumnMetadata, Propertied
Direct Known Subclasses:
ProjectedColumn

public class DynamicColumn extends AbstractColumnMetadata
A dynamic column has a name but not a type. The column may be a map, array or scalar: we don't yet know. A dynamic column is the equivalent of an item in a name-only project list. This type can also represent a wildcard. A dynamic column is not a concrete data description: it must be resolved to an actual type before it can be used to create vectors, readers, writers, etc. The dynamic column allows the tuple metadata to be used to represent all phases of a schema lifecycle, including Drill's "dynamic" schema before a reader resolves the column to some actual type.
  • Field Details

  • Constructor Details

    • DynamicColumn

      public DynamicColumn(String name)
  • Method Details

    • structureType

      public ColumnMetadata.StructureType structureType()
    • isDynamic

      public boolean isDynamic()
      Description copied from interface: ColumnMetadata
      Reports if the column is dynamic. A dynamic column is one with a "type to be named later." It is valid for describing a dynamic schema, but not for creating vectors; to create a vector the column must be resolved to a concrete type. The context should make it clear if any columns can be dynamic.
      Specified by:
      isDynamic in interface ColumnMetadata
      Overrides:
      isDynamic in class AbstractColumnMetadata
      Returns:
      true if the column does not yet have a concrete type, false if the column type is concrete
    • schema

      public MaterializedField schema()
    • emptySchema

      public MaterializedField emptySchema()
    • cloneEmpty

      public ColumnMetadata cloneEmpty()
      Description copied from interface: ColumnMetadata
      Create an empty version of this column. If the column is a scalar, produces a simple copy. If a map, produces a clone without child columns.
      Returns:
      empty clone of this column
    • copy

      public ColumnMetadata copy()
    • isEquivalent

      public boolean isEquivalent(ColumnMetadata o)
      Description copied from interface: ColumnMetadata
      Report whether one column is equivalent to another. Columns are equivalent if they have the same name, type and structure (ignoring internal structure such as properties.)
      Specified by:
      isEquivalent in interface ColumnMetadata
      Overrides:
      isEquivalent in class AbstractColumnMetadata
    • columnString

      public String columnString()
      Description copied from interface: ColumnMetadata
      Converts column metadata into string representation accepted by the table schema parser.
      Specified by:
      columnString in interface ColumnMetadata
      Overrides:
      columnString in class AbstractColumnMetadata
      Returns:
      column metadata string representation
    • typeString

      public String typeString()
      Description copied from interface: ColumnMetadata
      Converts type metadata into string representation accepted by the table schema parser.
      Specified by:
      typeString in interface ColumnMetadata
      Specified by:
      typeString in class AbstractColumnMetadata
      Returns:
      type metadata string representation