Mappings of unified types to source and destination data types

Unified types are the data types that appear in the Avro or JSON events. They are a Datastream-specific, unified representation of a data type across multiple data sources and destinations that Datastream supports.

The unified types are the superset of all type representations across all supported source types, which represent the original source type in a generic but lossless way.

The following tables list:

  • The unified types associated with Datastream
  • The mappings between Oracle, MySQL, SQL Server, PostgreSQL and Salesforce datatypes and the Datastream unified types

Refer to theBigQuery destination documentation for information about the mappings between the data types for the different sources and BigQuery.

Datastream unified types

Type nameInfoAvro definitionJSON definition
BOOLEANbooleanbooleanboolean
BYTESA sequence of unsigned bytesbytesstring
DATEDays since the epoch A date logical typestring [ISO-8601]
DATETIMEThe date (in days since the epoch) and time (in microseconds since midnight)

A custom type

{  "type": "record",  "name": "datetime",  "fields": [    {"name": "date",     "type": "int",     "logicalType": "date"},    {"name": "time",     "type": "long",     "logicalType": "time-micros"}  ]}
string [ISO-8601]
DECIMAL (p,s)An arbitrary-precision signed decimal number A decimal logical typenumber
DOUBLE64-bit floating point numbersdoublenumber
FLOAT32-bit floating point numbersfloatnumber
INTEGERA 32-bit integerintnumber
INTERVALDuration between two events (in months, hours, and microseconds)

A custom type

{  "type": "record",  "name": "interval",  "fields": [    {"name": "months",     "type": "int"}    {"name": "hours",     "type": "int"},    {"name": "micros",     "type": "long"}  ]}
string [ISO-8601]
JSONA JSON object

A custom logical type

{  "type": "string",  "logicalType": "json"}
nested JSON
LONGA 64-bit integerlongnumber
NUMBERA numeric data type

A custom logical type

{  "type": "string",  "logicalType": "number"}
string
STRINGAn unlimited string lengthstringstring
TIMEHow many microseconds elapsed since midnight, regardless of timezone. A time-micros logical typestring [ISO-8601]
TIME_INTERVALHow many microseconds elapsed between two events

A custom logical type

{  "type": "long",  "logicalType": "time-interval-micros"}
long
TIMESTAMPHow many microseconds elapsed since the epoch, regardless of timezone A timestamp logical typestring [ISO-8601]
TIMESTAMP WITH TIME ZONEHow many microseconds elapsed since the epoch with a specific timezone offset in milliseconds

A custom type

{  "type": "record",  "name": "timestampTz",  "fields": [    {"name": "timestamp",     "type": "long"     "logicalType": "timestamp-micros"},    {"name": "offset",     "type": "int"     "logicalType": "time-millis"}  ]}
string [ISO-8601]
TIME WITH TIME ZONEHow many microseconds elapsed since midnight with a specific timezone offset

A custom type

{  "type": "record",  "name": "timeTz",  "fields": [    {"name": "time",     "type": "long"     "logicalType": "time-micros"},    {"name": "offset",     "type": "int",     "logicalType": "time-millis"}  ]}
string [ISO-8601]
UNSUPPORTEDAn unsupported data type

A custom logical type

{  "type": "null",  "logicalType": "unsupported"}
null
VARCHARA string with a maximum length of n characters

A custom logical type

{  "type": "string",  "logicalType": "varchar"  "length": N}
string

Map Oracle data types to Datastream unified types

Oracle data typeDatastream unified type
ANYDATAUNSUPPORTED
BFILESTRING
BINARY DOUBLEDOUBLE
BINARY FLOATFLOAT
BLOBBYTES
CHARVARCHAR
CLOBSTRING
DATEDATETIMEZero dates aren't supported and are replaced withNULL values.
DOUBLE PRECISIONDOUBLE
FLOAT(p)DOUBLE
INTERVAL DAY TO SECONDUNSUPPORTED
INTERVAL YEAR TO MONTHUNSUPPORTED
LONG/LONG RAWUNSUPPORTED
NCHARSTRING
NCLOBSTRING
NUMBERNUMBER
NUMBER(p,s<=0)

If p<=18, thenLONG. If p>18 or p=*, thenNUMBER.

If the scale value (s) is less than 0, then Datastream assignss to be equal to 0.
NUMBER(p,s>0)

If p=*, thenDECIMAL(38,s), elseDECIMAL(p,s).

If the precision value (p) is less than the scale value (s), then Datastream assignsp to be equal tos.
NVARCHAR2STRING
RAWSTRING
ROWIDSTRING
SDO_GEOMETRYUNSUPPORTED
SMALLINTINTEGER
TIMESTAMPTIMESTAMPZero dates aren't supported and are replaced withNULL values.
TIMESTAMP WITH TIME ZONETIMESTAMP WITH TIME ZONEZero dates aren't supported and are replaced withNULL values.
UDT (user-defined type)UNSUPPORTED
UROWIDUNSUPPORTED
VARCHARVARCHAR
VARCHAR2VARCHAR
XMLTYPEUNSUPPORTED

Map MySQL data types to Datastream unified types

MySQL data typeDatastream unified type
BIGINT(size) SIGNEDLONG
BIGINT(size) UNSIGNEDIf the destination is BigQuery, thenDECIMAL, if Cloud Storage, thenNUMBER
BINARY(size)STRING (hex encoded)
BIT(size)LONG
BLOB(size)STRING (hex encoded)
BOOLINTEGER
CHAR(size)STRING
DATEIf the destination is BigQuery, thenDATE, if Cloud Storage, thenTIMESTAMP
DATETIME(fsp)If the destination is BigQuery, thenDATETIME, if Cloud Storage, thenTIMESTAMP
DECIMAL(size, d)DECIMAL(size, d)
DOUBLE(size, d)DOUBLE
ENUM(val1, val2, val3, ...)STRING
FLOAT(p)FLOAT
FLOAT(size, d)FLOAT
GEOMETRYUNSUPPORTED
INTEGER(size) SIGNEDINTEGER
INTEGER(size) UNSIGNEDLONG
JSONIf the destination is BigQuery, thenJSON, if Cloud Storage, thenSTRINGFor BigQuery,BOOLEAN,NUMBER,OBJECT,STRING,ARRAY andNULL data types are supported.
LONGBLOBSTRING (hex encoded)
LONGTEXTSTRING
MEDIUMBLOBSTRING (hex encoded)
MEDIUMINT(size)INTEGER
MEDIUMTEXTSTRING
SET(val1, val2, val3, ...)STRING
SMALLINT(size)INTEGER
TEXT(size)STRING
TIME(fsp)If the destination is BigQuery, thenINTERVAL, if Cloud Storage, thenTIME_INTERVAL
TIMESTAMP(fsp)TIMESTAMP
TINYBLOBSTRING (hex encoded)
TINYINT(size)INTEGER
TINYTEXTSTRING
VARBINARY(size)STRING (hex encoded)
VARCHARSTRING
YEARINTEGER

Map PostgreSQL data types to Datastream unified types

PostgreSQL data typeDatastream unified type
ARRAYJSONArrays ofDATE,TIMESTAMP orTIMESTAMP WITH TIME ZONE data types aren't supported.
BIGINTLONG
BITBYTES
BIT_VARYINGBYTES
BOOLEANBOOLEAN
BOXUNSUPPORTED
BYTEABYTES
CHARACTER
  • If there is limit for length, then map toVARCHAR
  • Otherwise, map toSTRING
CHARACTER_VARYING
  • If there is limit for length, then map toVARCHAR
  • Otherwise, map toSTRING
CIDRSTRING
CIRCLEUNSUPPORTED
CITEXTSTRING
COMPOSITEUNSUPPORTED
DATEDATE
DOUBLE_PRECISIONDOUBLE
ENUMSTRING
INETSTRING
INTEGERINTEGER
INTERVALINTERVAL
JSONJSON
JSONBJSON
LINEUNSUPPORTED
LSEGUNSUPPORTED
MACADDRSTRING
MONEYDOUBLE
NUMERIC
  • If precision = -1 and scale = -1 then map toNUMBER
  • Otherwise, map toDECIMAL
OIDLONG
PATHUNSUPPORTED
POINTUNSUPPORTED
POLYGONUNSUPPORTED
REALFLOAT
SMALLINTINTEGER
SMALLSERIALINTEGER
SERIALINTEGER
TEXTSTRING
TIMETIME
TIMESTAMPTIMESTAMP
TIMESTAMP_WITH_TIMEZONETIMESTAMP_WITH_TIMEZONE
TIME_WITH_TIMEZONETIME_WITH_TIMEZONE
TSQUERYSTRING
TSVECTORSTRING
TXID_SNAPSHOTSTRING
UUIDSTRING
XIDSTRING
XID8STRING
XMLSTRING

Map SQL Server data types to Datastream unified types

SQL Server data typeDatastream unified type
BIGINTLONG
BINARYBYTES
BITBOOLEAN
CHARSTRING
DATEDATE
DATETIME2DATETIME
DATETIMEDATETIME
DATETIMEOFFSETTIMESTAMP WITH TIMEZONE
DECIMALDECIMAL (p, s)
FLOATDOUBLE
INTINTEGER
IMAGEBYTES
MONEYDECIMAL
NCHARSTRING
NVARCHARSTRING
NVARCHAR(MAX)STRING
NTEXTSTRING
NUMERICDECIMAL (p, s)
REALFLOAT
SMALLDATETIMEDATETIME
SMALLINTINTEGER
SMALLMONEYDECIMAL
TEXTSTRING
TINYINTINTEGER
TIMETIME
TIMESTAMP/ROWVERSIONBYTES
UNIQUEIDENTIFIERSTRING
VARCHARSTRING
VARCHAR(MAX)STRING
VARBINARYBYTES
VARBINARY(MAX)BYTES
XMLSTRING

Map Salesforce data types to Datastream unified types

There are two types of data types that Salesforce supports:

Primitive data type mappings

Salesforce data typeDatastream unified type
BOOLEANBOOLEAN
BYTEBYTES
DATEIf the destination is BigQuery, thenDATE, if Cloud Storage, thenTIMESTAMP
DATETIMEIf the destination is BigQuery, thenDATETIME, if Cloud Storage, thenTIMESTAMP
DOUBLEDOUBLE
INTINTEGER
STRINGSTRING
TIMETIME

Field data type mappings

Salesforce data typeDatastream unified type
ADDRESSSub-fields of this compound field are replicated with their respective data types
ANYTYPE

(can be eitherSTRING,DATE,NUMBER, orBOOLEAN)

STRING
COMBOBOXSTRING
CURRENCYDOUBLE
DATACATEGORYGROUPREFERENCESTRING
EMAILSTRING
ENCRYPTEDSTRINGSTRING
GEOLOCATIONSub-fields of this compound field are replicated with their respective data types
IDSTRING
JUNCTIONIDLISTSTRING
MASTERRECORDSTRING
MULTIPICKLISTSTRING
PERCENTDOUBLE
PHONESTRING
PICKLISTSTRING
REFERENCESTRING
TEXTAREASTRING
URLSTRING

MongoDB data types

Each MongoDB document is written asJSON unified type in Datastream.For examples of how data types are written in BigQuery, seeConfigure a BigQuery destination.

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.