Data type conversion
This document describes default conversions of data types of supported databases into target redis data types.
General ANSI SQL Data Types
Source Data Type | Target Data Type for Hash | Target Data Type for JSON | Example for Hash | Example for JSON |
---|---|---|---|---|
array | not supported | not supported | ||
bigint | string | number | 2147483648 will be saved as ‘2147483648’ | 2147483648 will be saved as 2147483648 |
binary | bytes string. bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting binary.handling.mode . |
bytes string | When binary.handling.mode = bytes the string 'hello' will be added to the table as the binary string '0x68656C6C6F' ,will be converted by Debezium to 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' and will be stored in Redis Target DB as: 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' |
When binary.handling.mode = bytes the string 'hello' will be added to the table as the binary string '0x68656C6C6F' ,will be converted by Debezium to 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' and will be stored in Redis Target DB as: 'aGVsbG8AAAAAAAAAAAAAAAAAAAA=' |
bit string | not supported | not supported | ||
blob | bytes string. bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting binary.handling.mode . |
bytes string | When binary.handling.mode = bytes the binary image file ,which was loaded into the table ,will be converted by Debezium to bytes and will be stored in Redis Target DB as bytes string |
When binary.handling.mode = bytes the binary image file ,which was loaded into the table ,will be converted by Debezium to bytes and will be stored in Redis Target DB as bytes string |
boolean | string | boolean | The boolean value: false will be converted by the Applier to 0 and will be saved in Redis Target DB as the string ‘0’ | The boolean value:true will be saved in Redis Target DB as boolean data type with value True |
char | string |
string | When PostgreSQL data type is char(14) ‘hello world’ will be saved as ‘hello world ' | When PostgreSQL data type is char(14) ‘hello world’ will be saved as ‘hello world ' |
date | string Mapped to ms.microsec since epoch |
number Mapped to ms.microsec since epoch |
PG field value: '2021-01-29' will be converted by Debezium to the int 18656 (number of dates since epoch), which will be converted to number of ms since epoch and will be stored in Redis Target DB as: '1611878400000' |
PG field value: 2021-01-29 will be converted by Debezium to the int 18656 (number of dates since epoch), which will be converted to number of ms since epoch and will be stored in Redis Target DB as: 1611878400000 |
integer | string | number | 2147483640 will be saved as '2147483640' |
2147483640 will be saved as 2147483640 |
interval | not supported | not supported | ||
null | The field with null value will be sent by Debezium as null and will not be stored in Redis Target DB |
The field with null value will be sent by Debezium as null and will be stored in Redis Target DB with the value null |
||
numeric | string Debezium configuration parameter decimal.handling.mode determines how the connector maps decimal values.When decimal.handling.mode = 'precision' the binary string,recieved by Debezium,will be converted to its corresponding numeric value and will be stored in Redis Target DB as string |
Debezium configuration parameter decimal.handling.mode determines how the connector maps decimal values. When decimal.handling.mode = 'precision' the binary string received by Debezium will be converted to its corresponding numeric value and will be stored in Redis Target DB db as number. When decimal.handling.mode = 'string' the string ,received by Debezium, will be stored in Redis Target DB as string. When decimal.handling.mode = 'double' the double value received by Debezium will be stored in Redis Target DB as number. |
PG field value: 4521398.56 will be converted by Debezium to binary string 'GvMbUA==' , which will be converted to numeric value and will be stored in Redis Target DB as: '4521398.56' |
decimal.handling.mode = string : PG field value: 4521398.56 will be recieved by Debezium as the string '4521398.56' , and will be stored in Redis Target DB as the string: ‘4521398.56 ’ . |
smallint | string | number | 32767 will be saved as ‘32767’ | 32767 will be saved as 32767 |
text | string | string | ‘This is a very long text for the PostgreSQL text column’ | |
time | string mapped to number of seconds past midnight |
number mapped to the number of seconds past midnight |
'14:23:46' will be converted to '51826000000' sec |
'14:23:46' will be converted to 51826000000 sec |
PostgreSQL, Oracle, Cassandra: timestamp MySQL, SQL Server: datetime |
string mapped to ms.microsec since epoch. SQL Server datetime format: YYYY-MM-DD hh:mm:ss[.nnn] , range: 1753-01-01 through 9999-12-31 |
decimal mapped to ms.microsec since epoch. SQL Server datetime format: YYYY-MM-DD hh:mm:ss[.nnn] , range: 1753-01-01 through 9999-12-31 |
PG field value: '2018-06-20 15:13:16.945104' will be converted by Debezium to '1529507596945104' (micro seconds) and will be stored in Redis Target DB as '1529507596945.104' |
PG field value: '2018-06-20 15:13:16.945104' will be converted by Debezium to '1529507596945104' (micro seconds) and will be stored in Redis Target DB as 1529507596945.104 |
PosrgreSQL: timestamptz Oracle: timestamp with local timezone MySQL: timestamp |
string converted to UTC and stored as number of ms.microsec since epoch |
number converted to UTC and stored as number of ms.microsec since epoch |
||
timetz | string converted to UTC and stored as number of seconds past midnight |
number converted to UTC and stored as number of ms.microsec since epoch |
PG field value: '14:23:46.12345' will be converted by Debezium to the string '12:23:46.12345Z' and will be stored in Redis Target DB as: '44638.345' |
PG field value: '14:23:46.12345' will be converted by Debezium to the string '12:23:46.12345Z' and will be stored in Redis Target DB as: 44638.345 |
varbinary | bytes string. bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting binary.handling.mode . |
bytes string. bytes or base64-encoded String, or a hex-encoded String, based on the connector configuration property setting binary.handling.mode . |
When binary.handling.mode = bytes the string 'hello' will be added to the table as the binary string '0x68656C6C6F' ,will be converted by Debezium to 'aGVsbG8=' and will be stored in Redis Target DB as: 'aGVsbG8=' |
When binary.handling.mode = bytes the string 'hello' will be added to the table as the binary string '0x68656C6C6F' ,will be converted by Debezium to 'aGVsbG8=' and will be stored in Redis Target DB as: 'aGVsbG8=' |
varchar | string | string | ‘hello world’ will be saved as ‘hello world’ | ‘hello world’ will be saved as ‘hello world’ |
xml | string | string | ‘<contact-info> <name>Tanmay Patil</name> <company>TutorialsPoint</company> <phone>(011) 123-4567</phone> </contact-info>’ |
‘<contact-info> <name>Tanmay Patil</name> <company>TutorialsPoint</company> <phone>(011) 123-4567</phone> </contact-info>’ |
Cassandra Specific Data Types
Source Data Type | Source Data Type for HASH | Target Data Type for JSON | Example for Hash | Example for JSON |
---|---|---|---|---|
ascii | string | string | ||
counter (64-bit long) | string | number | ‘2’ | 2 |
date | not supported | not supported | ||
decimal | not supported | not supported | ||
double | string | number | ‘1.007308023’ | 1.007308023 |
duration | not supported | not supported | ||
float | string | number | The number -3.4E+38 will be received by debezium as -3.4E38 , will be converted by the Applier to -340000000000000000000000000000000000000 and will be saved in Redis Target DB as '-340000000000000000000000000000000000000' |
The number -3.4E+38 will be received by debezium as -3.4E38 and will be saved in Redis Target DB as -1e+38 |
frozen | string | array | {'10.10.11.1', '10.10.10.1', '10.10.12.1'} will be saved in Redis Target DB as a string: '{'10.10.11.1', '10.10.10.1', '10.10.12.1'}' |
{'10.10.11.1', '10.10.10.1', '10.10.12.1'} will be saved in Redis Target DB as an array: {'/10.10.11.1', '/10.10.10.1', '/10.10.12.1'} |
frozen udt | string | object | {'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'} will be saved in Redis Target DB as a string: '{'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'}' |
{'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'} will be saved in Redis Target DB as string will be saved in Redis Target DB as an object: {'city': 'City','street': 'Street','streetno': 2,'zipcode': '02-212'} |
inet | string IPv4 and IPv6 network addresses |
string IPv4 and IPv6 network addresses |
The IP address 4.35.221.243 will be converted by debezium to '/4.35.221.243' and will be saved in Redis Target DB as '/4.35.221.243' |
The IP address 4.35.221.243 will be converted by debezium to '/4.35.221.243' and will be saved in Redis Target DB as '/4.35.221.243' |
list | string | array | The list ['New York', 'Paris','London','New York'] will be sent by debezium as array of strings: ['New York', 'Paris','London','New York'] and will be saved in Redis Target DB as the string "['New York', 'Paris','London','New York']" |
The list ['New York', 'Paris','London','New York'] will be sent by debezium as array of strings: ['New York', 'Paris','London','New York'] and will be saved in Redis Target DB as an array: ['New York', 'Paris','London','New York'] |
map | string | object | {'fruit' : 'Apple', 'band' : 'Beatles'} will be saved in Redis Target DB as a string: '{'fruit' : 'Apple', 'band' : 'Beatles'}' |
{'fruit' : 'Apple', 'band' : 'Beatles'} will be saved in Redis Target DB as an object: {'fruit' : 'Apple', 'band' : 'Beatles'} |
set | string | array | The set {'y','n'} will be saved in Redis Target DB as the string '{'y','n'}' |
The set {'y','n'} will be saved in Redis Target DB as an array: {'y','n'} |
tinyint | string | |||
uuid | string | string | b9980b96-a85b-411c-b8e7-4be55c123793 | b9980b96-a85b-411c-b8e7-4be55c123793 |
tuple | string | object | The tuple { "field1": 1, "field2": "testing tuple", "field3": 2 } will be saved in Redis Target DB as a string: ' { "field1": 1, "field2": "testing tuple", "field3": 2 }' |
The tuple { "field1": 1, "field2": "testing tuple", "field3": 2 } will be saved in Redis Target DB as an object: { "field1": 1, "field2": "testing tuple", "field3": 2 } |
varint | not supported | not supported |
MySQL and MariaDB Specific Data Types
Source Data Type | Source Data Type for HASH | Target Data Type for JSON | Example for Hash | Example for JSON |
---|---|---|---|---|
enum | string | string | MySQL enum value 'cat' will be stored in Redis Target DB as 'cat' |
MySQL enum value 'cat' will be stored in Redis Target DB as 'cat' |
geometry | not supported | not supported | ||
geometrycollection | not supported | not supported | ||
json | string | object | {“pid”: 102, “name”: “name2”} | {“pid”: 102, “name”: “name2”} |
linestring | not supported | not supported | ||
multilinestring | not supported | not supported | ||
multipoint | not supported | not supported | ||
multypolygon | not supported | not supported | ||
polygon | not supported | not supported | ||
set | string | string | '1,2,3' will be stored in Redis Target DB as: '1,2,3' |
'1,2,3' will be stored in Redis Target DB as: '1,2,3' |
year | string | number | The value '55' will be stored in the database as 2055 and will be sent by Debezium as int32 data type with value 2055 . It will be stored in Redis Target DB as the string '2055' as well |
The value '55' will be stored in the database as 2055 and will be sent by Debezium as int32 data type with value 2055 . It will be stored in Redis Target DB as the number 2055 as well |
Oracle Specific Data Types
Source Data Type | Source Data Type for HASH | Target Data Type for JSON | Example for Hash | Example for JSON |
---|---|---|---|---|
bfile | not supported | not supported | ||
binary_double | string | number | ‘1.7E+308’ | 1.7E+308 |
binary_float | string | number | ‘3.40282E38’ | 3.40282E38 |
clob | string | string | large block of text | large block of text |
float,real,double precision real = FLOAT(63),double precision = FLOAT(126). |
string | number/string | The value -3.402E+38 will be saved in Redis Target DB as the string '-340200000000000000000000000000000000000' when Debezium configuration parameter decimal.handling.mode = 'double' |
the value -3.402E+38 will be saved in Redis Target DB as the number -340200000000000000000000000000000000000 when Debezium configuration parameter decimal.handling.mode = 'double' |
long raw | not supported | not supported | ||
nchar | string - is Unicode data type that can store Unicode characters | string - is Unicode data type that can store Unicode characters | The string 'testing hebrew שלום' will be stored in Redis Target DB as ‘testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d ’ |
The string 'testing hebrew שלום' will be stored in Redis Target DB as ‘testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d ’ |
nclob | not supported | not supported | ||
number(p,s) | string | number | ‘10385274000.32’ | 10385274000.32 |
nvarchar | string - is Unicode data type that can store Unicode characters | string - is Unicode data type that can store Unicode characters | The string testing hebrew שלום' will be stored in Redis Target DB as ‘testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d ’ |
The string testing hebrew שלום' will be stored in Redis Target DB as ‘testing hebrew \xd7\xa9\xd7\x9c\xd7\x95\xd7\x9d ’ |
raw | not supported | not supported | ||
rowid | string | string | AAAR1QAAOAAAACFAAA | AAAR1QAAOAAAACFAAA |
timestamp with tz | string | number | '2021-12-30 14:23:46' will be converted by Debezium to the string '2021-12-30T14:23:46+02:00' and will be stored in Redis Target DB as the string: '1611878400000' which is the number of ms since epoch |
'2021-12-30 14:23:46' will be converted by Debezium to the string '2021-12-30T14:23:46+02:00' and will be stored in Redis Target DB as the number: 1611878400000 which is the number of ms since epoch |
urowid | not supported | not supported |
PostgreSQL Specific Data Types
Source Data Type | Source Data Type for HASH | Target Data Type for JSON | Example for Hash | Example for JSON |
---|---|---|---|---|
box | not supported | not supported | ||
cidr | string IPv4 and IPv6 networks addresses. |
string IPv4 and IPv6 networks addresses. |
‘4.35.221.243/32’ | ‘4.35.221.243/32’ |
circle | not supported | not supported | ||
domain | string | string | ||
hstore | string | string | ‘{“pages”:“368”,“author”:“Katherine Dunn”,“category”:“fiction”}’ | ‘{“pages”:“368”,“author”:“Katherine Dunn”,“category”:“fiction”} |
inet | string IPv4 and IPv6 network addresses |
string IPv4 and IPv6 network addresses |
‘4.35.221.243’ | ‘4.35.221.243’ |
json | string | object | “{“guid”: “9c36adc1-7fb5-4d5b-83b4-90356a46061a”, “name”: “Angela Barton”, “is_active”: null, “company”: “Magnafone” “address”: "178 Howard Place, Gulf, Washington,702”, “registered”: “2009-11-07T08:53:22 +08:00”, “latitude”: 19.793713, “longitude”: 86.513373, “tags”: [“enim”,“aliquip”,“qui" ]}” |
{“guid”: “9c36adc1-7fb5-4d5b-83b4-90356a46061a”, “name”: “Angela Barton”, “is_active”: null, “company”: “Magnafone” “address”: "178 Howard Place, Gulf, Washington,702", “registered”: “2009-11-07T08:53:22 +08:00”, “latitude”: 19.793713, “longitude”: 86.513373, “tags”: [“enim”,“aliquip”,“qui" ]} |
line | not supported | not supported | ||
macaddr | string mac addresses |
string mac addresses |
‘08:00:2b:01:02:03’ | ‘08:00:2b:01:02:03’ |
money | string | string | When decimal.handling.mode = 'double' the money value -8793780.01 will be received by Debezium as -8793780.01 with double data type, and will be stored in Redis Target DB as the string’-8793780.01 ’ |
When decimal.handling.mode = 'double' the money value -8793780.01 will be received by Debezium as -8793780.01 , with double data type and will be stored in Redis Target DB as the number -8793780.01 |
path | not supported | not supported | ||
point | not supported | not supported | ||
polygon | not supported | not supported | ||
uuid | string | string | ‘a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11’ | ‘a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11’ |
SQL Server Specific Data Types
Source Data Type | Source Data Type for HASH | Target Data Type for JSON | Example for Hash | Example for JSON |
---|---|---|---|---|
bit | string | boolean | When value >0 it will be converted by Debezium to true and will be saved in Redis Target DB as ‘1 ’ while when value = 0 it will be converted by Debezium to false and will be saved in Redis Target DB as ‘0 ’ |
When value >0 it will be converted by Debezium to true and will be saved in Redis Target DB as True while when value = 0 it will be converted by Debezium to false and will be saved in Redis Target DB as False |
datetime2 | string Represents the number of milliseconds since the epoch, and does not include timezone information. |
number Represents the number of milliseconds since the epoch, and does not include timezone |
When Debezium configuration parameter time.precision.mode='connect' , the value ‘2018-06-20 15:13:16.945104 ’ will be converted by Debezium to the value ‘1529507596945104 ’ and will be saved in Redis Target DB database as the string '1529507596945.104 ’ |
When Debezium configuration parameter time.precision.mode='connect' , the value ‘2018-06-20 15:13:16.945104 ’ will be converted by Debezium to the value ‘1529507596945104 ’ and will be saved in Redis Target DB database as the number 1529507596945.104 |
datetimeoffset | string | number | When Debezium configuration parameter decimal.handling.mode = 'precision' , the datetimeoffset datatype value ‘12-10-25 12:32:10 +01:00 ’ will be converted to the string ‘2025-12-10T12:32:10+01:00' and will be saved in Redis Target DB as 1765366330000 |
When Debezium configuration parameter decimal.handling.mode = 'precision' , the datetimeoffset datatype value ‘12-10-25 12:32:10 +01:00 ’ will be converted to the string ‘2025-12-10T12:32:10+01:00' and will be saved in Redis Target DB as the string 1765366330000 |
decimal,float,real | string range of values: decimal-10^38 +1 to 10^38,float-1.79E+308 to -2.23E-308, 0 and 2.23E-308 to 1.79E+308,real:- 3.40E + 38 to -1.18E - 38, 0 and 1.18E - 38 to 3.40E + 38 |
number/string | When Debezium configuration parameter decimal.handling.mode = 'precision' the value ‘-3.402E+38 ’ will be converted by Debezium to the binary string ‘/wAP3QCzc/wpiIGe8AAAAAA= ’ and will be saved in Redis Target DB as the string ‘-340200000000000000000000000000000000000 ’ |
When Debezium configuration parameter decimal.handling.mode = 'precision' the value ‘-3.402E+38 ’ will be converted by Debezium to the binary string ‘/wAP3QCzc/wpiIGe8AAAAAA= ’ and will be saved in Redis Target DB as the number -340200000000000000000000000000000000000 |
image | string Variable-length binary data from 0 through 2,147,483,647 bytes. |
string | ||
money | string range of values: -922,337,203,685,477,5808 to 922,337,203,685,477.5807 |
number/string depending on the value of decimal.handling.mode | When Debezium configuration parameter decimal.handling.mode = 'precision' the value 922337203685477.5807 will be converted by Debezium to the binary ‘f/////////8= ’ string and will be saved in Redis Target DB as the string ‘922337203685477.5807 ’ |
When Debezium configuration parameter decimal.handling.mode = 'precision' the value 922337203685477.5807 will be converted by Debezium to the binary ‘f/////////8= ’ string and will be saved in Redis Target DB as the number 922337203685477.5807 |
nchar | string - fixed-size string data , Unicode data type that can store Unicode characters | string | ||
nvarchar | string - variable-size string data, Unicode data type that can store Unicode characters | string - variable-size string data, Unicode data type that can store Unicode characters | ||
numeric | string range of values - 10^38 +1 to 10^38 |
number | When Debezium configuration parameter time.precision.mode = 'connect' and decimal.handling.mode = 'precision' , the value 1.00E +33 will be converted by Debezium to the binary string 'SztMqFqGw1MAAAAAAAAAAA==' and will be saved in Redis Target DB as the string '1000000000000000000000000000000000' |
When Debezium configuration parameter time.precision.mode = 'connect' and decimal.handling.mode = 'precision' , the value 1.00E +33 will be converted by Debezium to the binary string 'SztMqFqGw1MAAAAAAAAAAA==' and will be saved in Redis Target DB as the number1000000000000000000000000000000000 |
rowversion | string data type that exposes automatically generated, unique binary numbers within a database. rowversion is generally used as a mechanism for version-stamping table rows. |
string data type that exposes automatically generated, unique binary numbers within a database. rowversion is generally used as a mechanism for version-stamping table rows. |
0x00000000000007D0 | 0x00000000000007D0 |
smalldatetime | string represents the number of milliseconds past the epoch, and does not include timezone information. |
number represents the number of milliseconds past the epoch, and does not include timezone information. |
'2018-06-20 15:13:16 ’ will be converted by Debezium to 1529507580000 ms past the epoch and will be saved in Redis Data Integration as the string ‘1529507580000 ’. number of seconds: 16 will be not be included in the convertion and will not be saved in Redis Target DB |
'2018-06-20 15:13:16 ’ will be converted by Debezium to 1529507580000 ms past the epoch and will be saved in Redis Data Integration as the number 1529507580000 . number of seconds: 16 will be not be included in the convertion and will not be saved in Redis Target DB |
smallmoney | string range of values: - 214,748.3648 to 214,748.3647 |
number | When Debezium configuration parameter decimal.handling.mode = 'string' the value -214748.3648 will be converted by Debezium to the string '-214748.3648' and will be saved in Redis Target DB as ‘-214748.3648 ’ |
When Debezium configuration parameter decimal.handling.mode = 'string' the value -214748.3648 will be converted by Debezium to the string '-214748.3648' and will be saved in Redis Target DB as ‘-214748.3648 ’ |
Spatial Geometry Types | not supported | not supported | ||
Spatial Geography Types | not supported | not supported | ||
table | not supported | not supported | ||
text | Variable-length Unicode data | |||
uniqueidentifier | string | string | 06BEEF00-F859-406B-9A60-0A56AB81A97 | 06BEEF00-F859-406B-9A60-0A56AB81A97 |
* fields with “not supported” data type will not appear in target hash.