All Products
Search
Document Center

Tablestore:Data type mappings in SQL

Last Updated:May 15, 2024

The fields in SQL correspond to the fields that have the same names in the data table. The data types of the fields in SQL must match the data types of the fields that have the same names in the data table. This topic describes the mappings between the data types of the fields in SQL, data tables, and search indexes. Before you use SQL, make sure that the data types of the fields in SQL match the data types of the fields that have the same names in the data table.

Important
  • If you use VARBINARY and VARCHAR as the data types of primary key columns in SQL, we recommend that you set the maximum length of the primary key column values to 1,024 by using VARBINARY(1024) and VARCHAR(1024).

  • BIGINT in SQL and Integer in data tables are 64-bit integer data types.

  • You can use only BIGINT, VARBINARY, and VARCHAR as the data types of primary key column values in SQL.

Field data type in SQL

Field data type in data tables

Field data type in search indexes

BIGINT

Integer

Integer

  • VARBINARY (primary key column)

  • MEDIUMBLOB (attribute column)

Binary

Binary

  • VARCHAR (primary key column)

  • MEDIUMTEXT (attribute column)

String

KeyWord

Text

DOUBLE

Double

Double

BOOL

Boolean

Boolean