Class DataType


  • public class DataType
    extends Object
    Represents an EXASOL data type.
    • Field Detail

      • MAX_EXASOL_CHAR_SIZE

        public static final int MAX_EXASOL_CHAR_SIZE
        The constant MAX_EXASOL_CHAR_SIZE.
        See Also:
        Constant Field Values
      • MAX_EXASOL_VARCHAR_SIZE

        public static final int MAX_EXASOL_VARCHAR_SIZE
        The constant MAX_EXASOL_VARCHAR_SIZE.
        See Also:
        Constant Field Values
      • MAX_EXASOL_DECIMAL_PRECISION

        public static final int MAX_EXASOL_DECIMAL_PRECISION
        The constant MAX_EXASOL_DECIMAL_PRECISION.
        See Also:
        Constant Field Values
    • Method Detail

      • getPrecision

        public int getPrecision()
        Get the precision
        Returns:
        precision precision
      • getScale

        public int getScale()
        Get the scale
        Returns:
        scale scale
      • getSize

        public int getSize()
        Get the size
        Returns:
        size size
      • createVarChar

        public static DataType createVarChar​(int size,
                                             DataType.ExaCharset charset)
        Create a VARCHAR data type with a given size and character set
        Parameters:
        size - size of the data type in characters
        charset - character set to be used when creating the data type
        Returns:
        VARCHAR type
      • createMaximumSizeVarChar

        public static DataType createMaximumSizeVarChar​(DataType.ExaCharset charset)
        Create a VARCHAR data type with the maximum size supported by Exasol
        Parameters:
        charset - character set to be used when creating the data type
        Returns:
        VARCHAR type
      • createChar

        public static DataType createChar​(int size,
                                          DataType.ExaCharset charset)
        Create a CHAR data type with a given size and character set
        Parameters:
        size - size of the data type in characters
        charset - character set to be used when creating the data type
        Returns:
        CHAR type
      • createMaximumSizeChar

        public static DataType createMaximumSizeChar​(DataType.ExaCharset charset)
        Create a CHAR data type with the maximum size supported by Exasol
        Parameters:
        charset - character set to be used when creating the data type
        Returns:
        CHAR type
      • createDecimal

        public static DataType createDecimal​(int precision,
                                             int scale)
        Create a DECIMAL (i.e. fixed point value) data type
        Parameters:
        precision - total number of places before and after the point that an instance of this type can hold
        scale - number of decimal places behind the point
        Returns:
        DECIMAL data type
      • createDouble

        public static DataType createDouble()
        Create a DOUBLE (i.e. double-precision floating point value) data type
        Returns:
        DOUBLE data type
      • createDate

        public static DataType createDate()
        Create a DATE data type
        Returns:
        DATE data type
      • createUnsupported

        public static DataType createUnsupported()
        Create an UNSUPPORTED data type
        Returns:
        UNSUPPORTED data type
      • createTimestamp

        public static DataType createTimestamp​(boolean withLocalTimezone)
        Create a TIMESTAMP data type
        Parameters:
        withLocalTimezone - defines whether the timestamp is local time (true) or UTC(false)
        Returns:
        TIMESTAMP data type
      • createBool

        public static DataType createBool()
        Create a BOOL data type
        Returns:
        BOOL data type
      • createIntervalDaySecond

        public static DataType createIntervalDaySecond​(int precision,
                                                       int fraction)
        Create an INTERVAL DAY TO SECOND data type
        Parameters:
        precision - number of days the interval can span
        fraction - decimal places after the point
        Returns:
        INTERVAL DAY TO SECOND data type
        See Also:
        Interval data type (Exasol documentation)
      • createIntervalYearMonth

        public static DataType createIntervalYearMonth​(int precision)
        Create an INTERVAL YEAR TO MONTH data type
        Parameters:
        precision - number of years the interval can span
        Returns:
        INTERVAL YEAR TO MONTH data type
        See Also:
        Interval data type (Exasol documentation)
      • createHashtype

        public static DataType createHashtype​(int byteSize)
        Create a HASHTYPE data type
        Parameters:
        byteSize - size in bytes
        Returns:
        HASHTYPE data type
      • getExaDataType

        public DataType.ExaDataType getExaDataType()
        Get the Exasol data type without parameters
        Returns:
        Exasol data type
      • getCharset

        public DataType.ExaCharset getCharset()
        Get the character set
        Returns:
        character set
      • isWithLocalTimezone

        public boolean isWithLocalTimezone()
        Check whether the timestamp uses the local time zone
        Returns:
        true if the timestamp uses the local time zone
      • getIntervalType

        public DataType.IntervalType getIntervalType()
        Get the interval type
        Returns:
        interval type
      • getIntervalFraction

        public int getIntervalFraction()
        Get the interval fraction
        Returns:
        interval fraction
      • getByteSize

        public int getByteSize()
        Get the size in bytes.
        Returns:
        byte size
      • isSupported

        public boolean isSupported()
        Check if the data type is supported.
        Returns:
        true if the data type is supported by the Virtual Schema.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object