Skip to main content
Version: 3.12.0

Numeric types

nGQL supports both integer and floating-point number.

Integer

Signed 64-bit integer (INT64), 32-bit integer (INT32), 16-bit integer (INT16), and 8-bit integer (INT8) are supported.

TypeDeclared keywordsRange
INT64INT64 orINT-9,223,372,036,854,775,808 ~ 9,223,372,036,854,775,807
INT32INT32-2,147,483,648 ~ 2,147,483,647
INT16INT16-32,768 ~ 32,767
INT8INT8-128 ~ 127

Floating-point number

Both single-precision floating-point format (FLOAT) and double-precision floating-point format (DOUBLE) are supported.

TypeDeclared keywordsRangePrecision
FLOATFLOAT3.4E +/- 386~7 bits
DOUBLEDOUBLE1.7E +/- 30815~16 bits

Scientific notation is also supported, such as 1e2, 1.1e2, .3e4, 1.e4, and -1234E-10.

note

The data type of DECIMAL in MySQL is not supported.

Reading and writing of data values

When writing and reading different types of data, nGQL complies with the following rules:

Data typeSet as VIDSet as propertyResulted data type
INT64SupportedSupportedINT64
INT32Not supportedSupportedINT64
INT16Not supportedSupportedINT64
INT8Not supportedSupportedINT64
FLOATNot supportedSupportedDOUBLE
DOUBLENot supportedSupportedDOUBLE

For example, nGQL does not support setting VID as INT8, but supports setting a certain property type of TAG or Edge type as INT8. When using the nGQL statement to read the property of INT8, the resulted type is INT64.

  • Multiple formats are supported:

    • Decimal, such as 123456.
    • Hexadecimal, such as 0x1e240.
    • Octal, such as 0361100.

    However, NebulaGraph will parse the written non-decimal value into a decimal value and save it. The value read is decimal.

    For example, the type of the property score is INT. The value of 0xb is assigned to it through the INSERT statement. If querying the property value with statements such as FETCH, you will get the result 11, which is the decimal result of the hexadecimal 0xb.

  • Round a FLOAT/DOUBLE value when inserting it to an INT column.