Skip to main content
Last updated on

Hive to Doris Data Type Mapping

The following table describes how Doris 4.2 (branch-4.2) maps Hive external-table schemas when reading. Writes also depend on the target schema and supported write operations; the read mapping is not an automatic inverse mapping for writes.

Hive TypeDoris TypeComment
booleanboolean
tinyinttinyint
smallintsmallint
intint
bigintbigint
datedate
timestampdatetime(6)Mapped to datetime with precision 6
floatfloat
doubledouble
decimal(P, S)decimal(P, S)Defaults to decimal(9, 0) if precision not specified
char(N)char(N)
varchar(N)varchar(N)
stringstring
binaryVARBINARYSince 4.1.5, this type always maps to VARBINARY.
timestamp with local time zoneTIMESTAMPTZ(6)Since 4.1.5, this type always maps to TIMESTAMPTZ(6). Precision is capped at 6, so higher precision is lost.
arrayarray
mapmap
structstruct
otherunsupported

Usage Notes​

Child fields of complex types use the same mappings recursively. TIMESTAMPTZ represents an instant displayed in the session time_zone.

Hive Catalog derives schemas from Hive Metastore type strings. timestamp maps to DATETIME(6); nanosecond data in the underlying file does not automatically change the mapping to TIMESTAMP_NS. Types not listed as supported, including uniontype, are unsupported.

Implementation reference: HiveMetaStoreClientHelper.java (branch-4.2).