gsql/ Attribute Data Types
Last Updated: October 20, 2018A reference guide to the primitive, advanced, and collection data types used for vertex and edge attributes.
Attribute Data Types
In TigerGraph, every attribute of a vertex or edge must have an assigned data type.
1. Primitive Types
| Type | Description | Range / Precision | Default |
|---|---|---|---|
INT | 8-byte signed integer | -2^63 to 2^63-1 | 0 |
UINT | 8-byte unsigned integer | 0 to 2^64-1 | 0 |
FLOAT | 4-byte single-precision | ~7 decimal digits | 0.0 |
DOUBLE | 8-byte double-precision | ~16 decimal digits | 0.0 |
BOOL | Boolean value | true, false (1, 0) | false |
STRING | UTF-8 character string | Up to 10MB per object | "" |
[!TIP] Use
DOUBLEinstead ofFLOATwhen high precision is required for large numbers, asFLOATprecision is limited to 7 digits.
2. Advanced Types
DATETIME
Stores date and time as Unix epoch seconds (since Jan 1, 1970).
- Format:
YYYY-MM-DD hh:mm:ss - Range: 1582-10-15 to 9999-12-31.
- Note: Time zones are not supported natively; values are treated as UTC.
3. Collection Types
GSQL supports complex collections for attributes that require multiple values.
LIST<Type>: An ordered collection. Allows duplicates.SET<Type>: An unordered collection of unique elements.MAP<KeyType, ValueType>: A collection of key-value pairs (unique keys).
4. User-Defined Tuples (UDT)
A UDT is a custom structure with fixed-size fields. You must define it with TYPEDEF before use in a schema.
gsqlterminal# Define the UDT TYPEDEF TUPLE <field1 INT, field2 STRING(20), field3 DOUBLE> My_Tuple # Use in Schema CREATE VERTEX Person (PRIMARY_ID id STRING, metadata My_Tuple)
UDT Field Rules:
STRING(n): Requires a fixed character sizen.INT(n): Optional size (1, 2, 4, or 8 bytes). Default is 8.
On this page
TigerGraph Book
v1.0 Curated