4.3. Data Types in xGT¶
The following data types are supported in xGT. Each column of the schema of a frame must be one of these data types.
4.3.1. BOOLEAN¶
The BOOLEAN
type supports the storage of two values: true or false.
Use the case insensitive keywords TRUE
or FALSE
or the integer values 1 or 0 to assign a BOOLEAN
.
4.3.2. INTEGER¶
The INTEGER
type holds signed numeric values.
It stores any value between the range of -263 and 263 - 1.
Attempting to assign values outside this range causes an error.
4.3.3. FLOAT¶
The FLOAT
type holds single-precision (32-bit) floating-point values.
Inputs with precision greater than 32 bits are valid input but will be truncated.
The case-insensitive string NaN
is also an acceptable value.
Any other non decimal characters will result in an error.
4.3.4. DATE¶
The DATE
type holds a date composed of a day, month, and year.
The expected format for a DATE
is YYYY-MM-DD
where leading zeros must be given.
For example, a valid DATE
would be 2018-02-20
.
Assigning a DATE
property with a valid DATETIME
as described in the DATETIME
section will result in the DATETIME
being downcast and ignoring the time fields.
Attempting to assign any other type will result in an error.
4.3.5. TIME¶
The TIME
type holds a time composed of hours, minutes, seconds, and (optionally) microseconds.
The expected format for a TIME
is HH:MM:SS
where leading zeros must be given.
For example, a valid TIME
would be 06:10:50
.
Optionally, microseconds can be included where the expected format is HH:MM:SS.μμμμμμ
.
For example, a valid TIME
with microseconds would be 06:10:50.020006
.
Attempting to assign any other type will result in an error.
4.3.6. DATETIME¶
The DATETIME
type holds a valid date and time separated by either a T
or a space, where the date and time must be formatted as described above.
It is composed of a day, month, year, hours, minutes, seconds, and optionally microseconds.
The expected format for a DATETIME
is YYYY-MM-DDTHH:MM:SS
, YYYY-MM-DD HH:MM:SS
, YYYY-MM-DDTHH:MM:SS.μμμμμμ
, or YYYY-MM-DD HH:MM:SS.μμμμμμ
.
For example, a valid DATETIME
would be 2018-12-20T06:10:50
or 2018-12-20 06:10:50.02006
.
Assigning a DATE
to a DATETIME
will result in the DATE
being “promoted” to a DATETIME
with zeros for the time fields.
Attempting to assign any other type will result in an error.
4.3.7. IPADDRESS¶
The IPADDRESS
type holds an IPv4 address.
The expected format of an IPADDRESS
is XXX.XXX.XXX.XXX
where each dot-separated value is between 0 and 255.
For example, a valid IPADDRESS
would be 172.16.254.1
.
Assigning any other type (including IPv6 addresses) will result in an error.
For situations where there are both IPv4 and IPv6 addresses in a single data source, it is recommended that the schema provide a TEXT
type for that data.
4.3.8. TEXT¶
The TEXT
type holds a string of UTF-8 encoded unicode characters.