This topic describes the mappings between the data types of fields in SQL, data tables, and search indexes. Before you use SQL, make sure that the field data types in SQL match the field data types in data tables.

  • 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).
  • Both BIGINT in SQL and Integer in data tables are 64-bit integer data types.
  • You can use only BIGINT, VARBINARY, and VARCHAR as the types of primary key column values in SQL.
Field data type in SQL Field data type in data tables Field data types in search indexes
BIGINT Integer Integer
  • VARBINARY (primary key)
  • MEDIUMBLOB (attribute column)
Binary Binary
  • VARCHAR (primary key)
  • MEDIUMTEXT (attribute column)
String Keyword
DOUBLE Double Double
BOOL Boolean Boolean