- Type Label (text to identify this type)
- Type Definition (list of columns)
- Properties (optional)
Type Label
A type label serves as a tagging mechanism for the type. The type label can be any text string specified by the client. The type label serves two purposes. First, it identifies tables with similar data. Second, it helps determine a type’s uniqueness.Type Definition
A type definition (sometimes referred to as type schema) consists of a set of column names, their respective base data types, and their nullability.Column Types
Each column in the database will have a specific type that is the combination of a base type and an optional set of column properties, listed below. A given column in a type definition must be of one of the following base types. If no data type column properties are specified to modify the base type, the column will take on the corresponding default specific type. For example, a column with an int base type and no column properties that modify the data type will have a specific type of int, which is a 32-bit signed integer. A column with an int base type and a data type column property of int16 will have a specific type of int16, which is a 16-bit signed integer.The following lists the specific type within each base type, the
number of bytes in memory an instance of the specific type
occupies, and the minimum and maximum values the specific type can
be assigned.
int
long
float
double
string
bytes
- For more information on complex column types, see: Arrays, JSON, and Vector Type.
- Character types use UTF-8 encoding and are defined using byte-designated sizes; the use of wide (multi-byte) characters will decrease the total number of characters that can be stored in a given fixed-width string type.
- The decimal type should be used instead of float or double when exact values of decimal places need to be represented. This is often used with currency.
- The decimal type will be stored in a byte size appropriate for the
pvalue (precision) specified;pvalues 18 and under will be stored in 8 bytes, whilepvalues 19 and over will be stored in 12 bytes. The maximumpvalue is 27 and the maximumsvalue (scale) is 18. - Any date/time within the year
9999can be used to denote an unknown or out-of-range date. No dates/times in between2900and9999will be recognized. - Adding nullability to a column requires an additional byte per value; e.g., a nullable integer requires 5 bytes in memory instead of 4.
- A valid UUID can be either 32 characters (without hyphens) or 36 characters
(with hyphens), e.g.,
1bd0b4cc0cbc11eb97be02420a000046or1bd0b4cc-0cbc-11eb-97be-02420a000046 - Numeric literals may be specified in decimal,
hexadecimal with a leading
0x, octal with a leading0o, or binary with a leading0b. For example, the number 42 may be represented in any of the following ways:42,0x2a,0o52, and0b101010. Hexadecimal, octal and binary literals may also be specified as:x'2a',o'52', andb'101010', respectively.