gsql/ Attribute Data Types
Last Updated: October 20, 2018

A 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

TypeDescriptionRange / PrecisionDefault
INT8-byte signed integer-2^63 to 2^63-10
UINT8-byte unsigned integer0 to 2^64-10
FLOAT4-byte single-precision~7 decimal digits0.0
DOUBLE8-byte double-precision~16 decimal digits0.0
BOOLBoolean valuetrue, false (1, 0)false
STRINGUTF-8 character stringUp to 10MB per object""

[!TIP] Use DOUBLE instead of FLOAT when high precision is required for large numbers, as FLOAT precision 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 size n.
  • INT(n): Optional size (1, 2, 4, or 8 bytes). Default is 8.