VARBINARY
VARBINARY
Description
A variable-length binary byte sequence, where M denotes the maximum length (in bytes).
Unlike VARCHAR, it preserves raw bytes without interpreting them using a character set or collation, suitable for arbitrary binary data (e.g., file fragments, hashes, encrypted/compressed data), with a maximum length of 2,147,483,647.
Currently, VARBINARY columns are not supported in created materialized views, or for use in Group By keys, Join Keys, and comparison predicates.
Version and limitations: Supported since 4.0; currently not supported as a column type for table creation and storage in Doris. You can map BINARY/VARBINARY fields from external systems to Doris VARBINARY via Catalogs for querying.
External Types and Restrictions Since 4.1.5
Since 4.1.5, Catalogs always preserve external binary types as VARBINARY; enable.mapping.varbinary=false no longer restores the STRING mapping. Iceberg fixed(N) maps to VARBINARY(N) and UUID to VARBINARY(16), including through Block serialization and data exchange. The file TVF option enable_mapping_varbinary is separate and still defaults to false; enable it explicitly when needed.
Hive Text binary fields use Hive-compatible Base64 encoding and decoding. Conversions involving hexadecimal representations require a 0x prefix and an even number of valid hexadecimal digits; invalid input returns Invalid VARBINARY hex representation.
This support does not enable native binary-column storage in Doris internal tables. VARBINARY cannot be used as a Hash Join or Group By key, in comparison predicates, IN or NOT IN, or in operations such as collect_set that lack binary semantics. Doris 4.1.5 rejects these uses explicitly.
keywords
VARBINARY