All Products
Search
Document Center

Hologres:Data types overview

Last Updated:Mar 25, 2026

Hologres is compatible with PostgreSQL data types and supports a subset of them. This page covers the native data types, one-dimensional array types, and type mappings from upstream systems including MaxCompute, Flink, MySQL, DLF, Hive, Hudi, Delta Lake, Paimon, and Iceberg.

Data types

The following table lists all data types supported by Hologres. All type names and aliases are case-insensitive in SQL but are shown in uppercase by convention.

NameAliasesStorage sizeDescriptionValue rangeExample
INTEGERINT, INT44 bytesCommon integer.-2,147,483,648 to +2,147,483,6472147483647
BIGINTINT88 bytesLarge-range integer.-9,223,372,036,854,775,808 to +9,223,372,036,854,775,8079223372036854775807
SMALLINT2 bytesSmall-range integer.-32,768 to +32,76732767
REALFLOAT44 bytesVariable-precision floating point, inexact. In the PostgreSQL ecosystem, FLOAT without a specified precision defaults to DOUBLE PRECISION (FLOAT8).6 decimal digits of precision123.123
DOUBLE PRECISIONFLOAT88 bytesVariable-precision floating point, inexact.15 decimal digits of precision123.123456789123
DECIMALNUMERICVariableExact numeric. Specify both PRECISION (total digits, 0–38) and SCALE (digits after the decimal point, 0–PRECISION).Up to 38 digits (integer + fractional parts combined)DECIMAL(38, 10)
BOOLEANBOOL1 byteBoolean.True / FalseTrue
TEXTVariableVariable-length string. Prefer TEXT over VARCHAR(n) or CHAR(n) for maximum flexibility.Noneabcdefg
CHAR(n)Fixed, up to n charactersFixed-length character string. Storage size does not exceed 1 GB.Up to n charactersabcd
VARCHAR(n)Variable, up to n charactersVariable-length string with a character limit. Storage size does not exceed 1 GB.Up to n charactersabcdefg
TIMESTAMP WITH TIME ZONETIMESTAMPTZ8 bytesTimestamp with time zone, stored with millisecond precision. If no time zone offset is specified, the system automatically adds the default time zone to the data.4713 BC to 294276 AD2004-10-19 10:23:54+02
TIMESTAMP8 bytesTimestamp without time zone, stored with microsecond precision.4713 BC to 5874897 AD2020-01-01 01:01:01.123456
DATE4 bytesDate, with day granularity.4713 BC to 5874897 AD2004-10-19
TIME8 bytesTime of day without time zone, with microsecond precision.00:00:00 to 24:00:0012:00:00
TIMETZ12 bytesTime of day with time zone, with microsecond precision.00:00:00 to 24:00:0012:00:00+08
INTERVAL16 bytesTime interval.-178,000,000 years to 178,000,000 yearsinterval '1 year'
JSONVariableJSON type. For details, see .NoneNone
JSONBVariableBinary JSON type. For details, see .NoneNone
BYTEAVariableVariable-length binary string. Storage size does not exceed 1 GB. For details, see Binary Data Types.NoneNone
BIT(n)n bitsFixed-length bit string. Storage size does not exceed 1 GB.NoneNone
VARBIT(n)Variable, up to n bitsVariable-length bit string. Storage size does not exceed 1 GB.NoneNone
INETVariableIPv4 or IPv6 host address. For details, see Network address types.None192.168.100.128/25
MONEY8 bytesCurrency amount with fixed fractional precision. For details, see Currency types.-92,233,720,368,547,758.08 to +92,233,720,368,547,758.0712.34 USD
OID4 bytesNumeric object identifier.None1024
UUID16 bytesUniversally unique identifier (UUID), fixed-length 128-bit value. uuid-ossp algorithms are not currently supported.00000000-0000-0000-0000-000000000000 to ffffffff-ffff-ffff-ffff-ffffffffffffa0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
SERIALVariableAuto-increment sequence. For details, see Auto-increment sequence.NoneNone
RoaringBitmapVariableEfficient INT array that supports constant array bitmap operations. For details, see RoaringBitmap functions.NoneNone
RoaringBitmap64VariableEfficient BIGINT array that supports constant array bitmap operations. For details, see RoaringBitmap functions.NoneNone

Version availability: Types not available in all versions were added in specific releases:

TypeAdded in
DATE, TIMESTAMP, CHAR(n), VARCHAR(n), SERIALHologres V0.8
SMALLINT, JSON, JSONB, BYTEA, BIT(n), VARBIT(n), TIMETZ, TIME, INET, MONEY, OID, UUIDHologres V0.9
RoaringBitmapHologres V0.10
RoaringBitmap64Hologres V3.1
All remaining typesAll Hologres versions

Examples

The following examples demonstrate common DDL and DML operations for selected types.

TIMESTAMP WITH TIME ZONE, DATE, DECIMAL, CHAR, and VARCHAR:

CREATE TABLE test_data_type (
  tswtz_column TIMESTAMP WITH TIME ZONE,
  date_column DATE,
  decimal_column DECIMAL(38, 10),
  char_column CHAR(20),
  varchar_column VARCHAR(225)
);

INSERT INTO test_data_type
VALUES ('2004-10-19 08:08:08', '2004-10-19', 123.456, 'abcd', 'a');

SELECT * FROM test_data_type;
      tswtz_column      | date_column | decimal_column |     char_column      | varchar_column
------------------------+-------------+----------------+----------------------+----------------
 2004-10-19 08:08:08+08 | 2004-10-19  | 123.4560000000 | abcd                 | a
(1 row)

BIT, VARBIT, and BYTEA:

-- BIT and VARBIT
CREATE TABLE test (a BIT(3), b BIT VARYING(5));
INSERT INTO test VALUES (B'101', B'00');
INSERT INTO test VALUES (B'10', B'101');

ERROR:  bit string length 2 does not match type bit(3)

INSERT INTO test VALUES (B'10'::bit(3), B'101');
SELECT * FROM test;

  a  |  b
-----+-----
 101 | 00
 100 | 101

-- BYTEA (escape output format)
SET bytea_output = 'escape';

SELECT 'abc \153\154\155 \052\251\124'::bytea;
     bytea
----------------
 abc klm *\251T

RESET bytea_output;  -- 'hex' is the default

SELECT 'abc \153\154\155 \052\251\124'::bytea;
          bytea
--------------------------
 \x616263206b6c6d202aa954
(1 row)

Array types

Hologres supports one-dimensional arrays only. The following table shows the supported array types with declaration and usage syntax.

TypeDescriptionDeclare in DDLInsert with ARRAY keywordInsert with {} syntaxQuery single elementQuery a range
int4[]One-dimensional integer arraycol int4[]ARRAY[1, 2, 3, 4]'{1, 2, 3, 4}'col[3]col[1:2]
int8[]One-dimensional bigint arraycol int8[]ARRAY[1, 2, 3, 4]'{1, 2, 3, 4}'col[3]col[1:2]
float4[]One-dimensional real arraycol float4[]ARRAY[1.0, 2.0]'{1.0, 2.0}'col[1]col[1:2]
float8[]One-dimensional double precision arraycol float8[]ARRAY[1.0, 2.0, 3.0]'{1.0, 2.0, 3.0}'col[1]col[1:2]
boolean[]One-dimensional boolean arraycol boolean[]ARRAY[true, true, false]'{true, true, false}'col[1]col[1:2]
text[]One-dimensional text arraycol text[]ARRAY['foo1', 'foo2', 'foo3']'{"foo1", "foo2", "foo3"}'col[1]col[1:2]

Full example:

-- Declare
CREATE TABLE array_example(
  int4_array    int4[],
  int8_array    int8[],
  float4_array  float4[],
  float8_array  float8[],
  boolean_array boolean[],
  text_array    text[]
);

-- Insert using the ARRAY keyword
INSERT INTO array_example(int4_array, int8_array, float4_array, float8_array, boolean_array, text_array)
VALUES (
  ARRAY[1, 2, 3, 4],
  ARRAY[1, 2, 3, 4],
  ARRAY[1.0, 2.0],
  ARRAY[1.0, 2.0, 3.0],
  ARRAY[true, true, false],
  ARRAY['foo1', 'foo2', 'foo3']
);

-- Insert using the {} syntax
INSERT INTO array_example(int4_array, int8_array, float4_array, float8_array, boolean_array, text_array)
VALUES (
  '{1, 2, 3, 4}',
  '{1, 2, 3, 4}',
  '{1.0, 2.0}',
  '{1.0, 2.0, 3.0}',
  '{true, true, false}',
  '{"foo1", "foo2", "foo3"}'
);

-- Query a single element (1-based index)
SELECT int4_array[3] FROM array_example;

-- Query a range
SELECT int4_array[1:2] FROM array_example;

Data type mapping between MaxCompute and Hologres

The following table shows how MaxCompute types map to Hologres types when creating a MaxCompute foreign table.

If a MaxCompute table contains fields of unsupported types, you can still query supported fields, provided the query does not access the unsupported fields.
MaxCompute typeHologres typeAvailable sinceNotes
JSONJSONBHologres V4.1
STRING, VARCHARTEXTAll versions
BIGINTINT8All versions
INTINT4, INTAll versions
FLOATFLOAT4, REALAll versions
DOUBLEFLOAT, FLOAT8All versions
BOOLEANBOOLAll versions
DATETIMETIMESTAMP WITH TIME ZONEAll versionsMaxCompute DATETIME uses China Standard Time (UTC+8). Range: January 1, 0000 to December 31, 9999, with millisecond precision.
DECIMALNUMERICAll versionsDefault precision is (38,18) when not specified. When you use IMPORT FOREIGN SCHEMA to create a table, the system automatically converts the precision.
TIMESTAMPTIMESTAMP WITH TIME ZONEHologres V0.8MaxCompute TIMESTAMP range: 0000-01-01 00:00:00.000000000 to 9999-12-31 23:59:59.999999999 (nanosecond precision). Hologres TIMESTAMPTZ uses millisecond precision; precision is converted automatically during reads.
CHAR(n)CHAR(n) (default); TEXT (optional)Hologres V0.8Fixed-length character type; n is the length, maximum 255. Padded with spaces if shorter than n. To map to TEXT, set hg_enable_convert_type_for_foreign_table = true and change the field type to TEXT when creating the table.
VARCHAR(n)VARCHAR(n) (default); TEXT (optional)Hologres V0.8Variable-length character type; n ranges from 1 to 65,535. To map to TEXT, set hg_enable_convert_type_for_foreign_table = true and change the field type to TEXT when creating the table.
DATEDATEHologres V0.8
SMALLINTINT2 (default); INT8 (optional)All versions (INT4 in V0.8, INT2 in V0.9)To map to INT8, set hg_enable_convert_type_for_foreign_table = true and change the field type to INT8 when creating the table.
TINYINTINT2 (default); INT8 (optional)All versions (INT4 in V0.8, INT2 in V0.9)To map to INT8, set hg_enable_convert_type_for_foreign_table = true and change the field type to INT8 when creating the table.
CHAR (no length)Not supportedNot supported
ARRAY\<INT\>INT4[]Hologres V0.8
ARRAY\<BIGINT\>INT8[]Hologres V0.8
ARRAY\<FLOAT\>FLOAT4[]Hologres V0.8
ARRAY\<DOUBLE\>FLOAT8[]Hologres V0.8
ARRAY\<BOOLEAN\>BOOLEAN[]Hologres V0.8
ARRAY\<STRING\>TEXT[]Hologres V0.8
BINARYBYTEAHologres V0.9
ARRAY\<TINYINT\>Not supportedNot supported
ARRAY\<SMALLINT\>Not supportedNot supported

Data type mapping between Blink/Flink and Hologres

The following table shows how Flink types map to Hologres types.

Binlog source tables support only a subset of data types. For more information, see Consume Hologres Binlog in real time with Flink/Blink.
Flink typeHologres typeSupported Hologres versionSupported Flink version
INTINT4, INTAll versionsAll versions
BIGINTINT8All versionsAll versions
VARCHARTEXTAll versionsAll versions
DOUBLEFLOAT, FLOAT8, DOUBLE PRECISIONAll versionsAll versions
BOOLEANBOOLAll versionsAll versions
DECIMALNUMERICAll versionsAll versions
DATEDATEHologres V0.8All versions
TIMESTAMPTIMESTAMP WITH TIME ZONEAll versionsAll versions
FLOATFLOAT4, REALAll versionsAll versions
TINYINTSMALLINTAll versionsSink: VVR-4.0.13-Flink-1.13 and later. RPC mode is not supported. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: VVR-4.0.13-Flink-1.13 and later. RPC mode is not supported.
SMALLINTSMALLINTAll versionsSink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
TIMETIME and TIMETZAll versions. Starting from Hologres V2.1.24, Fixed Plan supports TIME and TIMETZ.Sink: VVR-4.0.13-Flink-1.13 and later. RPC mode is not supported. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: VVR-4.0.13-Flink-1.13 and later. RPC mode is not supported.
Note

Fixed Plan does not support the TIME type; avoid this type where possible. For details, see Fixed Plan.

VARCHARJSONBHologres V0.10Sink: VVR-4.0.12-Flink-1.13 and later. RPC mode is not supported. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: VVR-4.0.12-Flink-1.13 and later. RPC mode is not supported.
VARCHARJSONHologres V0.9Sink: VVR-4.0.12-Flink-1.13 and later. RPC mode is not supported. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: VVR-4.0.12-Flink-1.13 and later. RPC mode is not supported.
BYTESRoaringBitmapHologres V0.10Sink: VVR-4.0.12-Flink-1.13 and later. RPC mode is not supported. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: VVR-4.0.12-Flink-1.13 and later. RPC mode is not supported.
VARCHARGEOMETRY and GEOGRAPHYAll versions. Starting from Hologres V2.1, Fixed Plan supports writing GEOMETRY and GEOGRAPHY data.Sink: VVR-4.0.13-Flink-1.13 and later. RPC mode is not supported. Source: Not supported. Dimension: Not supported.
ARRAY\<INT\>int4[]Hologres V0.8Sink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
ARRAY\<BIGINT\>int8[]Hologres V0.8Sink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
ARRAY\<FLOAT\>float4[]Hologres V0.8Sink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
ARRAY\<DOUBLE\>float8[]Hologres V0.8Sink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
ARRAY\<BOOLEAN\>boolean[]Hologres V0.8Sink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
TEXT[]Hologres V0.8Sink: All versions. Source: VVR-6.0.3-Flink-1.15 and later. RPC mode is not supported. Dimension: All versions.
ARRAY\<VARCHAR\>Hologres V0.8Sink: All versions. Source: Hologres V4.0.19 and later, with Flink engine VVR-11.6-JDK11-Flink-1.20. Dimension: All versions.
CHARNot supportedNot supportedNot supported
BINARYNot supportedNot supportedNot supported
When using CTAS to synchronize data to Hologres, DECIMAL primary keys are mapped to TEXT, while non-primary key DECIMAL fields are mapped to DECIMAL. For more information, see Why does the primary key of a MySQL table with bigint unsigned become decimal when registering the Flink Catalog, but become text after synchronizing to Hologres using CTAS?

Data type mapping between MySQL and Hologres

For a migration walkthrough, see Migrate MySQL to Hologres.

MySQL typeHologres type
BIGINTBIGINT
BINARY(n)BYTEA
BITBOOLEAN
CHAR(n), CHARACTER(n)CHAR(n), CHARACTER(n)
DATEDATE
DATETIMETIMESTAMP WITHOUT TIME ZONE
DECIMAL(p,s), DEC(p,s)DECIMAL(p,s), DEC(p,s)
DOUBLEDOUBLE PRECISION
FLOATREAL
INT, INTEGERINT, INTEGER
MEDIUMINTINTEGER
NUMERIC(p,s)NUMERIC(p,s)
SMALLINTSMALLINT
TINYBLOB, BLOB, MEDIUMBLOB, LONGBLOBBYTEA
TINYINTSMALLINT
TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXTTEXT
TIMETIME WITHOUT TIME ZONE
TIMESTAMPTIMESTAMP WITH TIME ZONE
VARBINARY(n), VARBINARY(max)BYTEA
VARCHAR(n)VARCHAR(n)
VARCHAR(max)TEXT

Data type mapping between DLF and Hologres

DLF typeHologres type
TINYINTSMALLINT
SMALLINTSMALLINT
INTINT
BIGINTBIGINT
BOOLEANBOOLEAN
FLOATREAL
DOUBLEDOUBLE PRECISION
DATEDATE
TIMESTAMPTIMESTAMP WITHOUT TIME ZONE
STRINGTEXT
BINARYBYTEA
DECIMAL(m,n)NUMERIC(m,n)
VARCHAR(n)CHARACTER VARYING(n)
CHAR(n)CHAR(n)
ARRAY\<type\>ARRAY\<hologres_data_type\>. Supported element types: INT, BIGINT, FLOAT, BOOLEAN, DOUBLE, STRING

Data type mapping between Hive and Hologres

Hive typeHologres type
TINYINTSMALLINT
SMALLINTSMALLINT
INTINT
BIGINTBIGINT
FLOATREAL
DOUBLEDOUBLE PRECISION
DECIMALNUMERIC
NUMERICNUMERIC
DATEDATE
TIMESTAMPTIMESTAMP WITHOUT TIME ZONE
STRINGTEXT
VARCHARVARCHAR
CHARCHAR
BINARYBYTEA
BOOLBOOLEAN
ARRAY\<type\>ARRAY\<hologres_data_type\>. Supported element types: INT, BIGINT, FLOAT, BOOLEAN, DOUBLE PRECISION, STRING

Data type mapping between Hudi and Hologres

This mapping is supported in Hologres V1.3 and later.

Hudi typeHologres type
IntegerTypeINT
LongTypeBIGINT
FloatTypeREAL
DoubleTypeDOUBLE PRECISION
DecimalTypeNUMERIC
TimestampTypeTIMESTAMP WITHOUT TIME ZONE
DateTypeDATE
YearMonthIntervalTypeNot supported
DayTimeIntervalTypeNot supported
StringTypeTEXT
VarcharTypeNot supported
CharTypeNot supported
BooleanTypeBOOL
BinaryTypeBYTEA
ByteTypeNot supported
ShortTypeNot supported
ArrayType(elementType, containsNull)ARRAY\<hologres_data_type\>. Supported element types: INT, BIGINT, FLOAT, BOOLEAN, DOUBLE PRECISION, STRING

Data type mapping between Delta Lake and Hologres

This mapping is supported in Hologres V1.3 and later.

Delta Lake typeHologres type
TINYINTSMALLINT
SMALLINTSMALLINT
INTINT
BIGINTBIGINT
FLOATREAL
DOUBLEDOUBLE PRECISION
DECIMAL(p,s)NUMERIC
TIMESTAMPTIMESTAMP WITHOUT TIME ZONE
DATEDATE
INTERVAL intervalQualifierNot supported
STRINGTEXT
BOOLEANBOOLEAN
BINARYBYTEA
ARRAY\<elementType\>ARRAY\<hologres_data_type\>. Supported element types: INT, BIGINT, FLOAT, BOOLEAN, DOUBLE PRECISION, STRING

Data type mapping between Paimon and Hologres

Paimon typeHologres type
TINYINTSMALLINT
SMALLINTSMALLINT
INTINT
BIGINTBIGINT
FLOATREAL
DOUBLEDOUBLE PRECISION
DECIMAL(p,s)DECIMAL
TIMESTAMPTIMESTAMP WITHOUT TIME ZONE
DATEDATE
CHARCHAR
VARCHARVARCHAR
BINARYBYTEA
ARRAYARRAY\<hologres_data_type\>. Supported element types: INT, BIGINT, FLOAT, BOOLEAN, DOUBLE PRECISION, STRING

Data type mapping between Iceberg and Hologres

Iceberg typeHologres type
BOOLEANBOOLEAN
INTINTEGER
LONGBIGINT
FLOATREAL
DOUBLEDOUBLE PRECISION
DECIMAL(P,S)NUMERIC(P,S)
DATEDATE
TIMETEXT (Spark does not support the TIME type. Flink's TIME type becomes STRING when written to DLF.)
TIMESTAMPTIMESTAMP WITHOUT TIME ZONE
TIMESTAMPTZNot supported
STRINGTEXT
UUIDNot supported (Flink and Spark cannot write this type.)
FIXED(L)BYTEA
BINARYBYTEA
LISTARRAY\<hologres_data_type\>. Supported element types: INT, BIGINT, FLOAT, BOOLEAN, DOUBLE PRECISION, STRING
STRUCTNot supported
MAPNot supported