Package com.exasol.adapter.metadata
Class DataType
- java.lang.Object
-
- com.exasol.adapter.metadata.DataType
-
public class DataType extends Object
Represents an EXASOL data type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DataType.ExaCharset
The enum Exa charset.static class
DataType.ExaDataType
The enum Exa data type.static class
DataType.IntervalType
The enum Interval type.
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_EXASOL_CHAR_SIZE
The constant MAX_EXASOL_CHAR_SIZE.static int
MAX_EXASOL_DECIMAL_PRECISION
The constant MAX_EXASOL_DECIMAL_PRECISION.static int
MAX_EXASOL_VARCHAR_SIZE
The constant MAX_EXASOL_VARCHAR_SIZE.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DataType
createBool()
Create aBOOL
data typestatic DataType
createChar(int size, DataType.ExaCharset charset)
Create aCHAR
data type with a given size and character setstatic DataType
createDate()
Create aDATE
data typestatic DataType
createDecimal(int precision, int scale)
Create aDECIMAL
(i.e.static DataType
createDouble()
Create aDOUBLE
(i.e.static DataType
createGeometry(int srid)
Create aGEOMETRY
data typestatic DataType
createHashtype(int byteSize)
Create aHASHTYPE
data typestatic DataType
createIntervalDaySecond(int precision, int fraction)
Create anINTERVAL DAY TO SECOND
data typestatic DataType
createIntervalYearMonth(int precision)
Create anINTERVAL YEAR TO MONTH
data typestatic DataType
createMaximumSizeChar(DataType.ExaCharset charset)
Create aCHAR
data type with the maximum size supported by Exasolstatic DataType
createMaximumSizeVarChar(DataType.ExaCharset charset)
Create aVARCHAR
data type with the maximum size supported by Exasolstatic DataType
createTimestamp(boolean withLocalTimezone)
Create aTIMESTAMP
data typestatic DataType
createUnsupported()
Create anUNSUPPORTED
data typestatic DataType
createVarChar(int size, DataType.ExaCharset charset)
Create aVARCHAR
data type with a given size and character setboolean
equals(Object o)
int
getByteSize()
Get the size in bytes.DataType.ExaCharset
getCharset()
Get the character setDataType.ExaDataType
getExaDataType()
Get the Exasol data type without parametersint
getGeometrySrid()
Get the Spatial Reference System Identifier (SRID) that was used to encode the geometryint
getIntervalFraction()
Get the interval fractionDataType.IntervalType
getIntervalType()
Get the interval typeint
getPrecision()
Get the precisionint
getScale()
Get the scaleint
getSize()
Get the sizeint
hashCode()
boolean
isSupported()
Check if the data type is supported.boolean
isWithLocalTimezone()
Check whether the timestamp uses the local time zoneString
toString()
-
-
-
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 aVARCHAR
data type with a given size and character set- Parameters:
size
- size of the data type in characterscharset
- character set to be used when creating the data type- Returns:
VARCHAR
type
-
createMaximumSizeVarChar
public static DataType createMaximumSizeVarChar(DataType.ExaCharset charset)
Create aVARCHAR
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 aCHAR
data type with a given size and character set- Parameters:
size
- size of the data type in characterscharset
- character set to be used when creating the data type- Returns:
CHAR
type
-
createMaximumSizeChar
public static DataType createMaximumSizeChar(DataType.ExaCharset charset)
Create aCHAR
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 aDECIMAL
(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 holdscale
- number of decimal places behind the point- Returns:
DECIMAL
data type
-
createDouble
public static DataType createDouble()
Create aDOUBLE
(i.e. double-precision floating point value) data type- Returns:
DOUBLE
data type
-
createDate
public static DataType createDate()
Create aDATE
data type- Returns:
DATE
data type
-
createUnsupported
public static DataType createUnsupported()
Create anUNSUPPORTED
data type- Returns:
UNSUPPORTED
data type
-
createTimestamp
public static DataType createTimestamp(boolean withLocalTimezone)
Create aTIMESTAMP
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 aBOOL
data type- Returns:
BOOL
data type
-
createGeometry
public static DataType createGeometry(int srid)
Create aGEOMETRY
data type- Parameters:
srid
- Spatial Reference System Identifier- Returns:
GEOMETRY
data type- See Also:
- Spatial Reference System Identifier (Wikipedia)
-
createIntervalDaySecond
public static DataType createIntervalDaySecond(int precision, int fraction)
Create anINTERVAL DAY TO SECOND
data type- Parameters:
precision
- number of days the interval can spanfraction
- 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 anINTERVAL 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 aHASHTYPE
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
-
getGeometrySrid
public int getGeometrySrid()
Get the Spatial Reference System Identifier (SRID) that was used to encode the geometry- Returns:
- SRID geometry srid
- See Also:
- Spatial Reference System Identifier (Wikipedia)
-
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.
-
-