Enum ValueType

java.lang.Object
java.lang.Enum<ValueType>
org.apache.drill.exec.vector.accessor.ValueType
All Implemented Interfaces:
Serializable, Comparable<ValueType>

public enum ValueType extends Enum<ValueType>
Represents the primitive types supported to read and write data from value vectors. Vectors support many data widths. For simplicity (and because of no difference in performance), the get/set methods use a reduced set of types. In general, each reader and writer supports just one type. Though some may provide more than one (such as access to bytes for a STRING value.)
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The value is set from a boolean: BIT.
    The value is set from a byte buffer.
    The value is set from a Joda LocalDate.
    The value is set from a BigDecimal: any of Drill's decimal types.
    Type is set from a double: FLOAT4 and FLOAT8.
    Type is set from a float: FLOAT4.
    The value is set from an integer: TINYINT, SMALLINT, INT, UINT1, and UINT2.
    The value set from a long: BIGINT and UINT4.
    The value has no type.
    The value is set from a Period.
    The value can be set from a string (for convenience).
    The value is set from a Joda LocalTime.
    The value is set from a Joda Instant.
  • Method Summary

    Modifier and Type
    Method
    Description
    static ValueType
    Returns the enum constant of this type with the specified name.
    static ValueType[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • BOOLEAN

      public static final ValueType BOOLEAN
      The value is set from a boolean: BIT.
    • INTEGER

      public static final ValueType INTEGER
      The value is set from an integer: TINYINT, SMALLINT, INT, UINT1, and UINT2.
    • LONG

      public static final ValueType LONG
      The value set from a long: BIGINT and UINT4.
    • FLOAT

      public static final ValueType FLOAT
      Type is set from a float: FLOAT4.
    • DOUBLE

      public static final ValueType DOUBLE
      Type is set from a double: FLOAT4 and FLOAT8.
    • STRING

      public static final ValueType STRING
      The value can be set from a string (for convenience). VARCHAR and VAR16CHAR.
    • BYTES

      public static final ValueType BYTES
      The value is set from a byte buffer. VARCHAR (in production code), VAR16CHAR, VARBINARY.
    • DECIMAL

      public static final ValueType DECIMAL
      The value is set from a BigDecimal: any of Drill's decimal types.
    • PERIOD

      public static final ValueType PERIOD
      The value is set from a Period. Any of Drill's date/time types. (Note: there is a known bug in which Drill incorrectly differentiates between local date/times (those without a timezone) and absolute date/times (those with a timezone.) Caveat emptor.
    • DATE

      public static final ValueType DATE
      The value is set from a Joda LocalDate. (Should upgrade to Java 8 LocalDate.) Native type is an int.
    • TIME

      public static final ValueType TIME
      The value is set from a Joda LocalTime. (Should upgrade to Java 8 LocalTime.) Native type is an int.
    • TIMESTAMP

      public static final ValueType TIMESTAMP
      The value is set from a Joda Instant. (Should upgrade to Java 8 Instant.) Native type is a long.
    • NULL

      public static final ValueType NULL
      The value has no type. This is typically a dummy writer used for unprojected columns.
  • Method Details

    • values

      public static ValueType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ValueType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null